In my Linux box, sleep accepts seconds, minutes and hours. So:sleep 10mSleeps for 10 minutes (or 600s).sleep on Mac only accepts seconds as argument. sleep 10m doesn't work, only sleep 600s.What can I do? Create a function named sleep that converts when 10m or 10h is passed as a parameter to seconds, and calls the builtin sleep?
Different sleep binaries on Mac (Darwin) and in Linux. How to properly handle the differences?
linux;shell;osx;sleep
You could use homebrew for Mac OS X: https://github.com/mxcl/homebrew and install the coreutils package from there. That will allow you to install the GNU version of sleep that handles the same parameters as the linux version.Note that by default it installs the binaries with a 'g' prefix, so the command will actually be named gsleep, but the package provides a script file to alias all commands.