Re: How to get the Previous month in Korn Shell
On Mar 19, 8:49 am, "John W. Krahn" <some...@example.com> wrote:
> narendra vuradi wrote:
> > Hi I have a requirement where i have to append the prev month (e.g Feb
> > for current date ) to the file name before sending it for some other
> > processing.
>
> > if input file name is
> > xyz.txt output for the today's run should be xyz_Feb.txt.
>
> $ date '+%b'
> Mar
> $ date -d 'last month' '+%b'
> Feb
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you
> can special-order certain sorts of tools at low cost and
> in short order. -- Larry Wall
hi when i ran the above code i am getting the following error
date: illegal option -- d
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
|