Calendar Program - kcal

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.

					#     kcal - Korn Shell calendar program
					# Process errors
					function error {
					print ${1:-"unexplained error encountered"}
					exit ${2}
					# Check arguments
					if (($# > 0))
					error "Usage: $0" 1
					# Use environment variable setting or default
					: ${CALFILE:=$HOME/.calfile}
					# Create calendar file if non-existent; flag
					# creation error
					if [[ ! -f $CALFILE ]]
					print "Creating default $HOME/.calfile"
					> $HOME/.calfile || error "$HOME/.calfile: \
					cannot create" ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.