poor mans watch, watch for solaris

Here is a simple script that you can use as watch in Solaris as well.

watch()
{
    #Poor man's watch
    while (true)
    do
        clear
        $*
        sleep 2;
    done
}

for loop in bash script on solaris without seq

Today I was working on a solaris box and wanted to do a watch. watch command is not available on Solaris 8 by default and I did not want to install it just for this small one time job. So I wrote this:

for (( i=0; i<=100; i++ )); do ls -lrt /tmp/amit*; sleep 2; done

You can replace the command in bold with whatever command you want to watch.

Script to Watch for Ubuntu 9.10 Launch – can be used in other scenarios.

I know ubuntu is out already but this is something that you can use to monitor a webpage.

This script will run check a for the Ubuntu 9.10 launch once every 5 mins and let you know when it\’s available:

 while [ 1 ]; do if [ -z \"`curl -I \"http://cdimage.ubuntu.com/releases/9.10/release/\"|grep \"404\"`\" ]; then kdialog --msgbox \"9.10 Released\"; exit; fi; sleep 300;  done

\"\"
\"\"

URL: http://www.shell-fu.org/lister.php?id=894

\"Reblog