我试图运行下面的陷阱命令,其中包含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