osascriptコマンドは
osascript -- execute AppleScripts and other OSA language scripts
とあるように、AppleScriptというOS Xアプリケーションを操作するスクリプトを実行するコマンドです。
そのまんま使う事も可能ですし、
$ osascript -e 'return "hello"'
クリップボードの中身をみたりもできます。
$ osascript -e 'get the clipboard' "hello"
が、アプリケーションと連動する事で真価を発揮します。
たとえば、
$ osascript -e 'tell Application "Finder" to display dialog "Job finished" '
とやると、Finderが
というポップアップを出してくれます。
パイプでつなぐ事もできるため、長めな処理を終えてFinderを表示…なんて用途にも使えそうです。
参考もと