On 14 May 2002, Alex Malinovich wrote: > if ps -A |grep -q "[x]screensaver"; then xscreensaver-command -activate > else xscreensaver& xscreensaver-command -activate; fi > > However, if I put that exact line into a shell script and run it, the if > ALWAYS gets evaluated as true. Any ideas?
I would test the output of grep. So change the line to if ps -A |grep -q "[x]screensaver" > /tmp/grep_output; then ... and look at /tmp/grep_output and you will see why grep returns true. Best regards, Andreas -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]