simple scripting problem
I need some simple syntax that will run "shutdown -y now" when scp is no longer running.
This is what I have so far.
while [ "pgrep scp" != "" ] ; do sleep 2; echo "mooo"; done
Of course this fails to do anything except stop printing "mooo" when scp exits.
Should I be using "case" after the echo?
I'm sure there are 20 ways to do this. I am looking for the most concise way; something I can memorize.
I don't really want a complete solution. I want hints and guidance. I should be able to figure this out myself.
Thanks.
|