Example : A Backup Script

#!/bin/sh# this requests date to return day of the week as a number w sunday = 0 d=(`date “+%w”`) #d=0# not necessary, but cool# week=([Mon]=0 [Tue]=1 [Wed]=2 [Thur])#Sunday is 0, saturday is 6DOW=(sunday monday tuesday wednesday thursday friday saturday)# remove existing files for the day/bin/rm /backup/${DOW[$d]}/*dbf.Z#date 2 compress is today – 2d2c=$(( $d – 2 …

Scripting Resources

Learn about using Arrays in the Advanced Bash-Scripting Guide at http://tldp.org/LDP/abs/html/arrays.html The Ultimate Resource: “Advanced Bash-Scripting Guide: An in-depth exploration of the art of shell scripting” by Mendel Cooper, at http://tldp.org/LDP/abs/html/index.html This guy is a genius, at both scripting and documentation. What more can I say?