Use Case
I am trying to send growl notices after a long terminal action has occurred. I'd like to be lazy and automatically be able to pass to growl the command that just occurred.
So I'd like to be able to run
npm install; growl
and have the growl function command pass through 'npm install' so I can get notified that that was the command that just finished.
I have the following in my .zshrc file:
p () { echo $1 }
I'm trying to echo the first half of this command:
ls; p
I really want the p function to output ls so I can send a notification about what was just executed.
My use case is that I'm trying to growlnotify myself when a command has finished by tacking ; p
or && p
at the end of it.
For the life of me I can't figure this out.
You would need to write the function like this:
p () {
$@ # execute cmd line
growl "$@" # send notification
}
Then call it like this:
p ls -al