OSX bash "sleep" OSX bash "sleep" shell shell

OSX bash "sleep"


This might be a little late, but it seems that sleep on OS X doesn't work with quantifiers (m,h, ...). Official Apple documentation

So "sleep 5m" is the same as "sleep 5". If you want 5 minutes, you have to use "sleep 300"


If you run which sleep, you can get the path to 'sleep' on your system. I get /bin/sleep.

At this point, you have a couple of options:

you can specify the path to sleep when you call it

#!/bin/bash# script before sleep .../bin/sleep# ... after sleep

or you can add the path to your $PATH variable within your script before you call it.

#!/bin/bashPATH="$PATH:/bin"# script before sleep ...sleep# ... after sleep