terminal – eBlog https://emresaglam.com/blog My Blog about my life and my thoughts... Wed, 12 Oct 2016 03:20:46 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 No timer in Mac OS X? No problem! https://emresaglam.com/blog/blog/2016/10/11/no-timer-in-mac-os-x-no-problem/ https://emresaglam.com/blog/blog/2016/10/11/no-timer-in-mac-os-x-no-problem/#respond Wed, 12 Oct 2016 03:20:46 +0000 http://emresaglam.com/blog/?p=1166 Continue reading No timer in Mac OS X? No problem! ]]> Mac OS X doesn’t come with a timer installed by default. There are bunch of timers in the App Store, you can definitely install one of those.

But here is how to make one from scratch. Open terminal screen and type:

sleep 5 ; say "Time is up"

Well that’s it 🙂 This command will sleep for 5 seconds and say “Time is up” at the end of 5 seconds.

We can make a little script out of it and save as /usr/local/bin/timer as below:

#!/bin/bash
sleep $1 ; say "Time is up"

You can invoke the command like this, it will sleep 5 seconds and tell you “Time is up”:

timer 5

As a bonus, if you want minutes instead of seconds, you can always do something like this which will run the timer for 5 minutes:

timer `echo "5*60" | bc`

]]>
https://emresaglam.com/blog/blog/2016/10/11/no-timer-in-mac-os-x-no-problem/feed/ 0