Create a gist now

Instantly share code, notes, and snippets.

An example of what you might do with the conditional shown in
#!/bin/zsh -f
PPID_NAME=$(/bin/ps -p $PPID | fgrep '/sbin/launchd' | awk '{print $NF}')
if [ "$PPID_NAME" = "/sbin/launchd" ]
# This IS launchd, so send the message via growlnotify so it will be seen
msg () {
growlnotify --message "$@" "$NAME"
# This is NOT via launchd, so send the message to stdout via 'echo'
msg () {
echo "$NAME: $@"
msg "Hello World"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment