How to show GUI dialog window from shell script on a Mac
When you run a shell script from a GUI app (from Alfred workflow, for example) you want to show an error and ask questions via GUI too. You can do it with AppleScript.
Show error message:
(You can use note or stop instead of caution to show a different icon.)
Ask question:
Or you can download dlg-error and dlg-prompt and put them somewhere in $PATH:
P. S. You can show notifications in the Notification Center using terminal-notifier.