How do I do date math in a bash script on OS X Leopard?

后端 未结 8 920
迷失自我
迷失自我 2021-02-03 21:15

I realize I could whip up a little C or Ruby program to do this, but I want my script to have as few dependencies as possible.

Given that caveat, how does one d

8条回答
  •  醉梦人生
    2021-02-03 21:23

    The command Matthew mentions works for me with /bin/date on Leopard. Besides, as Schwern points out, if you're sure your shell script is going to be run on Mac OS X, why don't you want to use Python or Ruby, that both come in standard in /usr/bin? This would in no way affect portability in your particular scenario.

提交回复
热议问题