home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume13
/
xcal
/
part02
/
scott_brim
/
vixc.csh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
1991-05-12
|
687b
|
30 lines
#!/bin/csh
#
# edit with vi an xcal daily diary file, with date defaulting to today.
# From: Scott Brim <swb@chumley.tn.cornell.edu>
# constants
set months = \
{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
# default to today
set thedate = `date +%m/%d/%y`
if ($1 != "") set thedate = $1
set month = `echo $thedate | cut -d/ -f1`
set monthname = $months[$month]
set day = `echo $thedate | cut -d/ -f2`
set year = `echo $thedate | cut -d/ -f3`
if ( $year < 100 ) @ year = $year + 1900
# build filename
set filename = "~/Calendar/xy"${year}"/xc"${day}${monthname}${year}
if ($?VISUAL) then
$VISUAL $filename
else
/usr/ucb/vi $filename
endif
exit $status