coreutils
coreutils copied to clipboard
coreutils: Print usage to stderr.
Scripts exist that may call one of the multi-binary entry points with argument 0 set to some other value than the name of the entry point.
One example is the Open vSwitch testsuite which makes use of /bin/true as an argument to the bash builtin exec to check whether it supports the '-a' argument [0].
In this situation coreutils will print usage on standard output, which makes unnecessary noise.
Printing usage on standard error, which is customary for other tools, allows the script to succeed.
0: https://github.com/openvswitch/ovs/blob/28064e9fa50d/tests/ovs-macros.at#L199
GNU testsuite comparison:
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)