myradar: a companion to myforecast
by Andrew Newman
One of a series of example shells:
This contribution is an extremely simple bash shell that I wrote for calling up the local
doppler radar map from Wunderground.com.
# program myradar
# version 1.0
# written by Andrew V. Newman
# last modified Tue Tue Mar 2 17:21:01 MST 2004
# shell script to bring up a current local radar
# Sets a default URL BASE
# NOTE: If you want to change this for your local area, go to
# wunderground.com and find the correct URL for your area.
# I modified mine quite a bit so as to only show the gif image
# with the full delay and number of images available. The only important value
# that needs to be changed to get your area but have it look like mine is the
# "ABX" in my URL path. For example, switch 'ABX' to 'LOT' to get Chicago.
# Set the default graphical browser
# I like galeon, but it may not be installed on your machine.
# ---------------------------- #
# If you can display a window on your terminal it will
# bring up your forecast in a graphical browser
if [ $DISPLAY ]; then
$GUI_BROWSER $URL 2> /dev/null
# Otherwise, it cannot work for you
echo "Sorry cannot bring up a display :("
# exit cleanly
A copy of this script exists in
Once you have finished creating this file all you need to do is:
- Change permissions of the file so that you can execute it:
% chmod 755 myradar
- Move file to a directory in your path:
I would suggest creating a bin directory from your home for all
shells and then making certain it is included in your path.
% mkdir ~/bin
If it is not already there, add the following line to ~/.cshrc if you are using a csh or tcsh shell
% mv myradar ~/bin/
path = ( $path ~/bin)
Or, if you are using bash add the following line to ~/.bashrc
If you followed the instructions in the commented area, you should be able to switch
the radar image to your area. Now that you have set your defaults, give the program a shot. Try running the following command:
Course Home | anewmangatech.edu | Updated:
Mon Sep 18 18:03:31 EDT 2006