3 ms·
./data_mining_job && growlnotify -m "Success!" || growlnotify -m "Failure :-(" (season with while, read and grep to taste)
by paulbaumgart 15y ago
./data_mining_job && growlnotify -m "Success!" || growlnotify -m "Failure :-("
(season with while, read and grep to taste)
- Lewisham 15y agoHah, if only it was so simple! The integrity of the job is the problem. It's been coded to failover problems (as the original data integrity its mining from isn't good), so it will happily do something stupid for hours. That's why I have to watch it, and make sure its not doing something stupid. Unit tests would ensure stupidity was not a possibility, and regressions could be tracked. Too late for that, unfortunately. So I watch.
- paulbaumgart 15y agoWhoops. Too late to edit, but a correction: growlnotify -m "Success! " (the space tells bash to treat the exclamation point as text)
- rcfox 15y agoOr just use \!
- deleted 15y ago[deleted]
- paulbaumgart 15y agoGood call. Though for multi-word messages, you'd have to do something like: growlnotify -m "$(echo Great\! Success\!)"
- qntm 15y agoFor arbitrary messages: sub escape { my $arg = shift; $arg =~ s/([^a-zA-Z0-9_])/\\$1/g; return $arg; }