Loop Over Output of a bash Command

Don't use for ; do ; done

For example, you want to terminate all perl processes :

$ ps | grep perl | cut -d' ' -f1,1 | read -r pid 

> do

> kill -9 $pid

> done

https://stackoverflow.com/questions/35927760/how-can-i-loop-over-the-output-of-a-shell-command

Comments

Popular Posts