#!/bin/bash # log [example script: LSGA Jul 2008] # usage: # log [prompts for comment]] # log -v [views comments] # log -e [edits comments] # log -p [prints comments] logfile=$HOME/logged.comments case $1 in "") read -p "log text: < " comment day=$(/bin/date -R|tr -d ','|awk '{print $1,$2,$3}') echo "$day: $comment">>$logfile tail -1 $logfile echo "logfile is $logfile" ;; -v|v) less $logfile ;; -e|e) nano $logfile ;; -p|p) a2ps $logfile; lpq ;; *) echo "usage: log [-v|-e|-p] or prompts for comment if blank" ;; esac exit 0