bash - Invalid date options in Ubuntu -


i have shell script ask system return year, 660days ago. on mac, use this:

date -j -v-660d +"%y" 

if run today, return 2011.

i'm moving script ubuntu machine, , receive error, stating -j , -v options invalid.

i've looked @ man page, looking equivalent options, haven't been able find solution.

any appreciated.

this should work:

$ date -d '660 days ago' +%y 2011 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -