Home » Infrastructure » Unix » Date function
Date function [message #305198] |
Mon, 10 March 2008 02:08  |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
Hi all,
I wrote a scripts as follows
#!/bin/ksh
year=`echo $1 cut -c 1-4`
month=`echo $1 | cut -c 5-6`
day=`echo $1 | cut -c 7-8`
set -A months \
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
monthname="${months[month]}"
echo "$monthname"_"$day"
Required O/P : if Jan 01-2008,Feb 02-2008
but i am getting using above script if Jan 00-2008
if feb 01-2008.
Please help me in thi sissue..
Thank you.
|
|
|
|
Goto Forum:
Current Time: Fri May 02 02:27:29 CDT 2025
|