我的.bash_profile中有以下内容:
k9 () { for A in $(ps -A | grep $* | sed 's/^\([A-Za-z0-9]*\).*/\1/' ; ) ; do "kill -9 $A"; done }脚本应该grep在命令行S*中输入的var,获取PID,并对每个PID执行kill -9。但我得到的却是:
Machine:~ mach$ k1 Chromium
-bash: kill -9 81922: command not found
-bash: kill -9 82009: command not found
-bash: kill -9 82423: command not found
-bash: kill -9 82424: command not found
-bash: kill -9 82560: command not found
-bash: kill -9 82561: command not found
-bash: kill -9 82563: command not found
-bash: kill -9 82608: command not found
-bash: kill -9 85243: command not found
-bash: kill -9 85248: command not found
-bash: kill -9 85321: command not found提前感谢!
https://stackoverflow.com/questions/38313123
复制相似问题