The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-10-2009
niceboykunal123 niceboykunal123 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 31
Substract date (month) Problem

#!/bin/ksh

month=`date | cut -c5-8`
year=`date | cut -c24-28`

echo "$month"
echo "$year"

--- This gives me output as Feb and 2009
but now I want to substract the 1 month from the current script and want output as

Jan 2009.


Please note I have searched a lot on forum and found option -v with date but it doesn't work wd on my mc.

Please help...!!!