将awk输出保存到变量BASH [重复]

时间:2022-04-26 23:52:43

This question already has an answer here:

这个问题在这里已有答案:

I need to save an output of a command in a variable and then to use it. Currently.

我需要在变量中保存命令的输出然后使用它。目前。

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

1 个解决方案

#1


-2  

Try:

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

Those are backticks.

这些都是反击。

#1


-2  

Try:

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

Those are backticks.

这些都是反击。