shell脚本:单引号陷阱命令中的awk引号

时间:2017-06-02 19:01:31

标签: awk quotes

我试图运行下面的陷阱命令,其中包含awk,但它失败了。我在报价中弄错了。有人可以帮助我:

trap 'ssh 0-1 "ps axf | grep $(echo $fname).pcap | grep -v grep | awk '{print \"kill -9 \" \$1}' | sh"' 2
-bash: trap: "kill: invalid signal specification
-bash: trap: -9: invalid signal specification
-bash: trap: ": invalid signal specification
-bash: trap: $1} | sh": invalid signal specification

0 个答案:

没有答案