[Rock-dev] fixed typos in function
Martin Zenzes
martin.zenzes at dfki.de
Thu Jan 9 13:47:06 CET 2014
function orokill {
if [ x"$1" = "x" ]; then
echo "argument to kill!"
return
fi
# get rid of the "grep" see http://stackoverflow.com/a/9375940
local procs=$(ps -eo pid,args|grep "$1"|grep -v grep)
for pr in "$procs"; do
echo "kill $pr?"
select answer in "kill" "skip"; do
case $answer in
kill ) kill $(echo "$pr" | sed -rn
's/[^[:digit:]]*([[:digit:]]+).+/\1/p');break;;
skip ) echo "skipping";break;;
esac
done
done
}
More information about the Rock-dev
mailing list