Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> date format in ksh
<span style='font-size:10.0pt;
font-family:Arial'>List,
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>Sorry to deviate from the topic, but
<span style='font-size:10.0pt;
font-family:Arial'>I am writing a korn shell script that would exit if the date
format is
<span style='font-size:10.0pt;
font-family:Arial'>incorrect.
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>I just need something to compare the date format passed<span
style='mso-spacerun:yes'> in with DD-MON-YYYY.
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>Eg.
<span style='font-size:10.0pt;
font-family:Arial'>I am passing an argument to my ksh script being the date.
<span style='font-size:10.0pt;
font-family:Arial'>If the date is in any other format but DD-MON-YYYY the ksh
must exit.
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>Eg. sh test.ksh <st1:date
Month="2" Day="5" Year="1999">02/05/1999<font
face=Arial>
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>It must exit.
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>The only format excepted should be
<span style='font-size:10.0pt;
font-family:Arial'>sh test.ksh 02-MON-YYYY
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>TIA
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>Regards
<span style='font-size:10.0pt;
font-family:Arial'>Suhen
<span style='font-size:10.0pt;
font-family:Arial'>
<span style='font-size:10.0pt;
font-family:Arial'>
Received on Thu Oct 25 2001 - 20:57:10 CDT
![]() |
![]() |