Re: csh method for manipulating a string
From: Jarzombek, Svend (Svend.Jarzombek_at_ALCOA.COM)
Date: 12/11/03
- Previous message: Holger.VanKoll_at_SWISSCOM.COM: "tsm tdp (oracle) 5.2 on aix 5.x"
- Maybe in reply to: Shawn Bierman: "csh method for manipulating a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 11 Dec 2003 11:30:38 +0100 To: aix-l@Princeton.EDU
Shawn,
try the following:
#####################################
#!/usr/bin/csh
set OLDDATE = "YYMMDD"
echo "OLDDATE: "$OLDDATE
set DAY=`echo $OLDDATE | cut -c5-6`
echo "DAY: "$DAY
set MONTH=`echo $OLDDATE | cut -c3-4`
echo "MONTH: "$MONTH
set YEAR=`echo $OLDDATE | cut -c1-2`
echo "YEAR: "$YEAR
set NEWDATE="$MONTH$DAY$YEAR"
echo "NEWDATE: "$NEWDATE
#####################################
Svend
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of
Shawn Bierman
Sent: Mittwoch, 10. Dezember 2003 22:32
To: aix-l@Princeton.EDU
Subject: csh method for manipulating a string
I have no experience with csh but I have a script that I must change. It
reads in a date of the format "YYMMDD" and I need to take that and change it
to "MMDDYY". Is csh capable of doing this without perl or awk?
-shawn
- Previous message: Holger.VanKoll_at_SWISSCOM.COM: "tsm tdp (oracle) 5.2 on aix 5.x"
- Maybe in reply to: Shawn Bierman: "csh method for manipulating a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]