News for hackers. Stuff that matters.
Re:GNU poke 1.0 by jolmg on Friday February 26, 2021 @02:16PM (#26278627)
Is the point of the pipe that the notification should include the output of the command like the following?

  ./backup.sh | ( notify-send "$(cat)" )
though that could also be written:

  notify-send "$(./backup.sh)"
If you also want the output in the terminal, you could use tee:

  ./backup.sh | tee >(notify-send "$(cat)")
If you want it to be an email or SMS, there are probably commands that you could replace notify-send with.
Re:GNU poke 1.0 by corobo on Friday February 26, 2021 @02:25PM (#26278741)
Not really sure with pipe. It could probably just be &&'d with an optional message parameter to be fair.

Or sprinkle some AI on it and decide based on the destination. I wouldn't want a huge log being sent via sms but nbd for email.

Re:GNU poke 1.0 by jolmg on Friday February 26, 2021 @02:28PM (#26278792)
> Or sprinkle some AI on it and decide based on the destination.

Or avoid that overcomplication and specify what you want. As the one writing the command, you should know if the output is big and what the ideal is for the destination you want.

Re:GNU poke 1.0 by corobo on Friday February 26, 2021 @02:42PM (#26278969)
You don't have to make it for me haha. This is not a product specification and I am not a demanding customer. It's a hypothetical command that popped into my head while browsing a site with hacker in the name.

It's also a command I could throw together in about an hour with a bit of bash if I really wanted it. Mix in a bit of curl, bit of whatever the sendmail command is these days, bit of Twilio. Job's a good'un.

For the record "sprinkle some AI on it" is if statements, it was a yoke.

Re:GNU poke 1.0 by wizzwizz4 on Friday February 26, 2021 @02:41PM (#26278950)
Have it specified in a config file, and provide presets for common configurations (e.g. last line and exit code in SMS but full log in email).