Date arithmetic in Unix shell scripts

前端 未结 14 1673
生来不讨喜
生来不讨喜 2020-11-27 22:29

I need to do date arithmetic in Unix shell scripts that I use to control the execution of third party programs.

I\'m using a function to increment a day and another

14条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 23:02

    Assuming you have GNU date, like so:

    date --date='1 days ago' '+%a'
    

    And similar phrases.

提交回复
热议问题