Difference between revisions of "/dev/stderr"
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
* [[Google style guide]]: https://google.github.io/styleguide/shellguide.html#stdout-vs-stderr | * [[Google style guide]]: https://google.github.io/styleguide/shellguide.html#stdout-vs-stderr | ||
+ | err() { | ||
+ | echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2 | ||
+ | } | ||
+ | |||
+ | if ! do_something; then | ||
+ | [[err]] "Unable to do_something" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
== Related == | == Related == |
Revision as of 10:21, 16 November 2022
Advertising: