I have lots of stuff in my crontab, including some that talks to my screen. If I'm not there for it to be notifying, I don't really want it to run.
Is there a way I can check to see if the computer is locked, so I can keep it from doing things when I'm not at my desk? Or, alternately, do other things only when I'm not at my desk?
grep
in a test, its best to usegrep -q
so that there is no output to the console. Also the parenthesis are redundant - they cause a sub-shell to be created though there's no need for that in this case. – Guss Apr 15 '11 at 17:39