4 ms·
> > chronic: runs a command quietly unless it fails > Isn't that just `command >/dev/null`? Often times you want to run a command silently (like in a build scr
by ninkendo 5y ago
> > chronic: runs a command quietly unless it fails
> Isn't that just `command >/dev/null`?
Often times you want to run a command silently (like in a build script), but if it fails with a nonzero exit status, you want to then display not only the stderr but the stdout as well. I’ve written makefile hacks in the past that do this to silence overly-chatty compilers where we don’t really care what it’s outputting unless it fails, in which case we want all the output. It would’ve been nice to have this tool at the time to avoid reinventing it.