I am trying the below command in Solaris. I am trying all this in bash
START_DT="$(date --date='2013-04-01' +'%Y-%m-%d')"
and its giving me the error
-bash-3.2$ START_DT="$(date --date='2013-04-01' +'%Y-%m-%d')"
date: illegal option -- date=2013-04-01
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
-bash-3.2$ START_DT=$(date -d '2013-04-01' +%Y-%m-%d)
date: illegal option -- d
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
When I try the same in RedHat it works.
$ START_DT="$(date --date='2013-04-01' +'%Y-%m-%d')"
$ echo $START_DT
'2013-04-01'
In the very same way certain arithmetic operation doesn't work. By Arithmetic operations I mean adding 10 days to a give date etc.
I have tried multiple references - 1, 2, 3 but nothing seems to work
But all this works on Redhat. May be I have a very old version of Solaris and I have to use only this server for this problem statement