I want to wrap a process around another to catch stderr messages when they occur.Use Case I'm using Compass and I have to have a terminal open and see if there is something wrong. My plan is to use terminal-notifier tool to send myself OSX notifications so I notice an error happened. Then I don't have to keep terminal open on my screen all the time.Imagine I have all this notification mechanism under a shell script named compass-error.sh which will send a notification when you call it. Now I want to run compass watch with my main process and watch for stderr to fire compass-error.sh. How do I do it?
Run a script when a process throws stderr message
process;stderr
output=$(./compass 2>&1 1>/dev/null)if [ -n $output ]; then  echo $output | mail ...fi