[wplug] Bash scripting help - count from 1 to 4
Gentgeen
gentgeen at linuxmail.org
Sat Jan 28 16:55:23 EST 2006
I am writing a bash script as part of my backup routine. What I need
to keep track of is which zip disk to use, Disk 1, 2, 3, or 4.
(rotating the disks out once a week)
Now I want to have a file, called DISK that will just contain one of
those numbers. What I want the script to do is something like this:
1) If file DISK does not exist, exit with
echo "Don't know the disk # in the drive"
2) If DISK # is 1,2,or 3 then increase it by 1
(so if the file contained a "1" now it will contain a "2")
3) If DISK # is 4 then reset by going back to 1
4) Give a variable to be used used later in the script with the
new number.
echo "Please replace old disk with Zip Disk number $NUMBER"
Any help would be appreciated.
--
*****************************************************************
Associate yourself with men of good quality if you esteem
your own reputation; for 'tis better to be alone then in bad
company. - George Washington, Rules of Civility
More information about the wplug
mailing list