BrianAtWork
Programmer
Hello All,
We use these lines in a script to get the last day of the month:
This always works well and we haven't had any problems... Until last month. For the month of october, $LastDayOfMonth is "30 31" for some reason. I tested this by typing these lines at the command prompt (KSH, by the way).
and the LastDayOfMonth variable holds "30 31"... Why is this? These 2 lines have always worked fine, so why did October not work? Any ideas anyone?
Thanks!
We use these lines in a script to get the last day of the month:
Code:
LastDayOfMonth=$(cal)
LastDayOfMonth=${LastDayOfMonth##* }
Code:
LastDayOfMonth=$(cal 10 2004)
LastDayOfMonth=${LastDayOfMonth##* }
Thanks!