4 ms·
I do wish that there was a standard pipeline for warnings, so stuff like this didn't have to go into error (bad) or output (worse). Powershell has such a featu
by Pxtl 4y ago
I do wish that there was a standard pipeline for warnings, so stuff like this didn't have to go into error (bad) or output (worse). Powershell has such a feature but of course since it's not at the OS/Posix level then support is spotty.
- bitofhope 4y agoYou can technically pipe to streams other than &1 and &2, so you could use printf "WARNING: %s" "$warn_msg" >&3 But of course, nonstandard.
- int_19h 4y agoWhy is it bad for it to go stderr? It's supposed to be used for all kinds of app meta-output, not just errors. If you want to actually check if the command failed, that's what exit codes are for. I did run into some Node.js code that assumed that anything printed out to stderr is a fatal error - but that's just people making wrong assumptions, not using the interface as intended.