News for hackers. Stuff that matters.
Re:Do You Understand Job Control in Bash? by guns on Thursday September 02, 2010 @06:23PM (#1657929)
Simple command line timer:

    remind() {
        [[ $# -ge 2 ]] || { echo >&2 "Usage: $FUNCNAME time msg"; return 1; }
        local sec="$(($1*60))"
        (   trap "echo \"\$sec seconds left\"" QUIT
            while ((--sec > 0)); do sleep 1; done
            say "${@:2}" # OS X only, replace with your favorite notifier
        ) 2>/dev/null &
    }

    $ remind 30 get the laundry
Query time remaining with kill -QUIT %jobspec. Good for systems that don't have at(1).
Re:Do You Understand Job Control in Bash? by moe on Thursday September 02, 2010 @07:04PM (#1658055)
Hm. That looks like quite a typing exercise. What's wrong with:

    ( sleep 1800 ; say "get the laundry" )&
Re:Do You Understand Job Control in Bash? by symkat on Thursday September 02, 2010 @07:08PM (#1658063)
His can be added to your .bashrc/.bash_profile, and then all you have to type is:

  remind [minutes] [message]
Functions can be imported to your shell. =)
Re:Do You Understand Job Control in Bash? by steve19 on Thursday September 02, 2010 @07:43PM (#1658132)
neat trick
Re:Do You Understand Job Control in Bash? by symkat on Thursday September 02, 2010 @06:56PM (#1658028)
Thanks, that's useful!

Favorite notifier:

  echo "${@:2}" | growlnotify -t Reminder -s -m -