|
|
|
Use Growl to monitor long-running shell commands
Ack! That works, but is not good. $1 is the WHOLE command, including all parameters. First, long commands can create a large notify box. Second, growlnotify tries to interpret any flags in that command - those parameters that start with a hyphen (this must be a bug). I tried quoting ${PREEXEC_CMD:-Some Command} but that didn't help.
How would you get the first word of $1, which would be just the command with no parameters?
Use Growl to monitor long-running shell commands
Try:
export PREEXEC_CMD="$(echo $1 | awk '{print $1}')"However, note that unless I'm mistaken, $BASH_COMMAND would include the entire command and all its arguments were it working. So, not sure if just getting the first word is entirely correct. I concur that this seems more like an issue with growlcode than with using $1 or $BASH_COMMAND. Perhaps instead of just taking the first word, a better workaroud would be to just replace the dash with another character like tilde: export PREEXEC_CMD="$(echo $1 | sed 's/-/~/g')"Now, at a quick glance it still looks right. -dbingham
Use Growl to monitor long-running shell commands
that awk bit works. Thanks.
The full command may be what was originally intended. But whether that's appropriate or not gets back to my first point - long commands (I often run configures with a long stream of options) can either create a large growl box, unless limited in the growl prefs. In the end, all I need to see for a quick notification is the command and not all its parameters. |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,413 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.03 seconds |
|