I have this alias in my tcsh:
Code:
alias hibernate 'xlock -mode blank &; sleep 2; echo -n mem >! /sys/power/state'
So when I run 'hibernate' the shell runs xlock to lock my desktop, waits 2 seconds then makes the computer hibernate. When the computer is woken up, it is properly locked. Fine.
Now I try to port it to a script:
Quote:
#!/bin/sh
xlock -mode blank &
sleep 2
echo -n mem >! /sys/power/state
|
It hibernates, but won't lock. If I remove the &, then it locks but won't hibernate immediately. It waits to be unlocked to hibernate.
What am I doing wrong?