The following is a demonstration of a script that uses the maybe command. #!/usr/bin/sh # # unlock - unlock a user account. Solaris. # # USAGE: unlock username # # NOTE: Assumes an account is locked by changing the shell, eg to a # custom script called /usr/bin/locked. PATH=/usr/sbin:/usr/bin username=$1 if [ "$username" = "" ]; then echo >&2 "USAGE: unlock username" exit 1 fi while : do if maybe then # unlock the account usermod -s /usr/bin/sh $username else # wait a day sleep `expr 24 \* 60 \* 60` fi done