Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thanks for the quick response. I'm writing it as an external script because command is meant to be any generic command/job I feed in. How would I change your code so that it's compatible to be run in the command | shell_script.sh "subject line" framework? Commented Nov 9, 2019 at 23:47
  • @nwly See updated answer. You simply can't have the exact pipeline that you propose as there is absolutely no way for the shell script to know whether the command failed or not. Commented Nov 9, 2019 at 23:57
  • Thanks for the detailed explanation. Commented Nov 10, 2019 at 0:35