The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: date format
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 01-25-2008
V3l0 V3l0 is offline
Registered User
  
 

Join Date: Nov 2007
Location: Belgium & France
Posts: 70

Code:
date1=28JAN2008
date2=$(echo $date1 | sed 's/'$(echo $date1 | cut -c4-5)'/'$(echo $date1 | cut -c4-5 | tr '[:upper:]' '[:lower:]')'/')

echo date1=$date1
echo date2=$date2

Result:

Code:
date1=28JAN2008
date2=28Jan2008

Hope it'll help