OS X: Displaying an alert box on command completion

In order to pop up an alert box on a Mac when a command finishes running, you can use this little bit of Applescript:

ssh devbox longrunningcommand && osascript -e 'tell application "Terminal" to display dialog "Your job is done"'

Additional information