I am using the date -d command to change a specific date format to another.Below is the example used currDate=`Wed 12 Feb 2014`formattedDate=`date -d${currDate} +%Y%m%d`echo $formattedDate
Unable to use date command to change specific date format in Bash shell on OS X terminal
bash;shell;quoting;date
You shouldn't use backticks (`) unless you are assigning the result of a command to a variable, in this case you are assigning a string so you should just quote it:currDate=Wed 12 Feb 2014formattedDate=`date -d${currDate} +%Y%m%d`echo $formattedDateI don't have access to a mac so I can't test this but according to the OSX date man page, this should work:formattedDate=`date -jf %a %d %b %Y ${currDate} +%Y%m%d`Many of the utilities in OSX are based on BSD versions of same so the info you find for Linux does not always translate to OSX. From man date on OSX: -f      Use input_fmt as the format string to parse the new_date provided         rather than using the default [[[mm]dd]HH]MM[[cc]yy][.ss] format. -j      Do not try to set the date.  This allows you to use the -f flag in          addition to the + option to convert one date format to another.