hans
Newbie
UID 171
Digest Posts
0
Credits 0
Posts 43
Reading Access 10
Registered Apr 25, 2007
Status Offline
|
|
|
case structure
case structure
hi,
can anyone help me with the following case structure?
code:
echo "please enter the date for which you want the report:\c"
read dat
d1=`echo $dat|cut -c7-8`
m1=`echo $dat|cut -c5-6`
y1=`echo $dat|cut -c1-4`
yr=`expr "$d1" - 1`
case "$yr" in
0)
month=`expr "$m1" - 1`
year=y1
;;
case "$m1" in
0)
month=12
year=`expr "$y1" - 1`
;;
esac
day=`cal $month $year |grep . | fmt -1 | tail -1`
esac
it returns me an error:
`"$m1"' is not expected
thanks for your help
|
|
|