我使用了以下bash代码:
for pid in `top -n 1 | awk '{if($8 == "R") print $1;}'`
do
kill $pid
done
它说:
./kill.sh: line 3: kill: 29162: arguments must be process or job IDs
./kill.sh: line 3: kill: 29165: arguments must be process or job IDs
./kill.sh: line 3: kill: 29166: arguments must be process or job IDs
./kill.sh: line 3: kill: 29169: arguments must be process or job IDs
有什么想法吗?谢谢!