January 2001
Intermediate to advanced
480 pages
7h 22m
English
This is a Korn shell script that implements a menu-driven calendar program. It supports addition, deletion, modification, and listing of calendar entries. It also provides the ability to find the calendar entry for the current day and list all calendar entries.
#!/bin/ksh # # kcal - Korn Shell calendar program # # Process errors function error { print ${1:-"unexplained error encountered"} exit ${2} } # Check arguments if (($# > 0)) then error "Usage: $0" 1 fi # Use environment variable setting or default : ${CALFILE:=$HOME/.calfile} # Create calendar file if non-existent; flag # creation error if [[ ! -f $CALFILE ]] then print "Creating default $HOME/.calfile" > $HOME/.calfile || error "$HOME/.calfile: \ cannot create" ...
Read now
Unlock full access