This question already has answers here:
How do I set a variable to the output of a command in Bash?
                                
                                    (14个回答)
                                
                        
                                3年前关闭。
            
                    
我需要将命令的输出保存在变量中,然后使用它。目前。

newExtend= $(awk 'NR=='$cont $directy)
echo $newExtend

最佳答案

尝试:

newExtend = `awk 'NR==' $count $directory`


那些是反引号。

09-27 23:22