#!/bin/tcsh
#first line defines using cshell
#set counter
set ctr = 0
#going to loop 3 times
while ( $ctr < 3 )
#get the current time and assign it to the variable now_date
set now_date = `date -u +%Y%m%d%H%M%S`
echo $now_date
#define file name that involves including a time stamp defined 
#by the date function
set file = wbbw_${now_date}.jpg
# write to screen info
echo grabbing wbbw image no $ctr and giving it name $file
#use the curl command to get the current image and write it to $file
curl "https://meso1.chpc.utah.edu/station_cameras/wbbw_cam/wbbw_cam_current.jpg" -o $file
#wait 10 seconds to get the next image
sleep 10
# update the counter
@ ctr++
#the loop will terminate when $ctr = 3
end
#copy the last image to a location where others can access it
#you must have created your public_html/atmos_5340/module1 subdirectory
cp $file ~/public_html/atmos_5340/module_1/
