How to subtract a year from a date stored in a variable in shell script?

后端 未结 0 624
梦如初夏
梦如初夏 2021-01-15 09:32
as_of_dt=\'2016-01-01\'
as_of_dt_prev_year=$($as_of_dt -d \'-1 year\' +\'%Y-%m-%d\')
echo $as_of_dt_prev_year

This does not work. error: -d: comman

相关标签:
回答
  • 消灭零回复
提交回复
热议问题