Monday, May 22, 2006

Linux script: wa

I've created this simple and potentially useful Linux script and named it "wa"
Here it is:
#!/bin/sh
while [ $1 ]
do
clear
$1
if `test $2`
then
sleep $2
else
sleep 1
fi
done
It can be used for example for printing out different statuses, for example if you are waiting for somebody to login to the Linux box, you could use ./wa w 1
It will run a "w" command on a clean screen every second, so you don't have to constantly keep pressing w [enter] w [enter] ...
I think it's simple but convenient - the one thing Linux is missing ^^

No comments: