On Sun, Mar 12, 2023, at 1:35 PM, Robert Elz via austin-group-l at The Open Group wrote: > With the GNU version, what would be more interesting to know, is what > it does when run as > true --nonsense > true ---------- > true '--:) (-;' > (and similar). What's the exit status, is there any output, and if > so, to stdout or stderr?
% /opt/local/libexec/gnubin/true --nonsense; echo "$?" 0 % /opt/local/libexec/gnubin/true ----------; echo "$?" 0 % /opt/local/libexec/gnubin/true '--:) (-;'; echo "$?" 0 > I'm also assuming that the --version and --help (to be meaningful "accepted" > rather than just ignored - everyone's true allows and ignores those, and > any other args given) actually produce some output. stdout or stderr? They print messages to stdout. > What happens (exit status etc) if there's a write error while writing that > output? % /opt/local/libexec/gnubin/true --version >&-; echo "$?" true: write error: Bad file descriptor 1 Interestingly, the documentation anticipates this concern: https://www.gnu.org/software/coreutils/manual/html_node/true-invocation.html -- vq