Date command does not follow Linux specifications (Mac OS X Lion)

后端 未结 3 1696
醉酒成梦
醉酒成梦 2020-11-28 07:53

I have been developing a script on my linux box for quite some time, and wanted to run it on my Mac as well.

I thought that the functions on the Mac were the same as

3条回答
  •  失恋的感觉
    2020-11-28 08:28

    This is because OSX and Linux use two different sets of tools. Linux uses the GNU version of the date command (hence, GNU/Linux). Remember that Linux is Linux and OS X is Unix. They're different.

    You can install the GNU date command which is included in the "coreutils" package from MacPorts. It will be installed on your system as gdate. You can either use that, or link the date binary with the new gdate binary; your choice.

提交回复
热议问题