View Single Post

  #1 (permalink)  
Old 01-30-2008, 04:12 AM
newbie4 newbie4 is offline
Junior Member
User
 
Join Date: Jan 2008
My distro: Debian
Posts: 1
Rep Power: 0
newbie4 is on a distinguished road
Default Shell date command for manipulation and formatting date

This will give a date using date utility to find next day for system date in a particular format .
date --date='next day' "+%Y%m%d" .

in the same way i need a output to get the next day or next month for any date which the user is passing as a parameter $1.
Say $1 (i pass as $1 as23/12/2007 then i need the 5 day of 23/12/2007 i.e output /result 28/12/2007)

something like this below

mydate=$1
date --date $mydate +%m%d%Y -d ýesterday (this does not work)

Is it possible ? if so pls give me the soln/command .

Thks
Reply With Quote