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
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.