I want to get the name of the previous month to define it as a variable in my shell script. I tried different commands available on the internet, but doesn't seem working, like:
TZ=CST+24 date +%b
gives me output as Apr
and
date -d "last month" '+%Y%m'
gives the output as :
date: illegal option -- d
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]
date [-a [-]sss.fff]
My expected output is Mar
or March