Date arithmetic in Unix shell scripts

前端 未结 14 1512
生来不讨喜
生来不讨喜 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 22:41

    Why not write your scripts using a language like perl or python instead which more naturally supports complex date processing? Sure you can do it all in bash, but I think you will also get more consistency across platforms using python for example, so long as you can ensure that perl or python is installed.

    I should add that it is quite easy to wire in python and perl scripts into a containing shell script.

提交回复
热议问题