PacSci
March 21st, 2009, 02:08 AM
I was practicing my shell command writing skills the other day, and I was wondering how long shell commands can get? It has to be useful, and the commands have to do something related (i.e. not just a string of random commands connected by ";" or "&&"). My best one is:
sudo -v; while true; do ps aU person_on_computer | awk '/their-web-browser/ {system("sudo kill " $1)}'; sleep 10; done
I just enter my password, and every ten seconds, the Web browser of the person currently sitting in my chair closes. This way, if someone is on the computer and I need to use it, then I just run this command while SSHed in from a laptop upstairs. They'll leave in about five minutes out of sheer frustration. Any more practical and less psychological-warfare-ish commands?
sudo -v; while true; do ps aU person_on_computer | awk '/their-web-browser/ {system("sudo kill " $1)}'; sleep 10; done
I just enter my password, and every ten seconds, the Web browser of the person currently sitting in my chair closes. This way, if someone is on the computer and I need to use it, then I just run this command while SSHed in from a laptop upstairs. They'll leave in about five minutes out of sheer frustration. Any more practical and less psychological-warfare-ish commands?