On 8/31/26 9:07 PM, Robert Elz wrote:
     Date:        Mon, 31 Aug 2026 09:53:50 -0400
     From:        Chet Ramey <[email protected]>
     Message-ID:  <[email protected]>

   | I'm pretty sure kre was using a script.

Indeed.   I have yet to imagine a use for an empty function in an interactive
shell ... if I want to do nothing, I just do nothing!  This is all for scripts.

   | A `false pipeline' (see my message to kre) exits with status 1, but the
   | null command is still having its exit status inverted, so it doesn't
   | cause the shell to exit.

Given that an empty command is allowed there, and that is somehow defined
to have a zero exit status (of course, one could define the exit status of an
empty command in a location a non-empty command is required, to be non-zero,
so just "!" would produce a 0 result, not what bash does, but it could)

https://austingroupbugs.net/view.php?id=267

"The format for a false pipeline is:
                !

                A false pipeline shall have no effect other than
                setting its exit status.

                Exit Status\fP

                The exit status of a false pipeline shall be 1.

                \fBExamples\fP
                The pipeline:
                \fCW!\fP

                is roughly equivalent to the command:
                \fCWfalse\fP"

   | See the grammar changes from interp 267.

Thanks, but I prefer not to revisit torture chambers, having escaped finally!

Ah, good times.

ps: while "time" (time nothing) might be another example, it is hardly
useful for the purpose of generating a nothing, as it still (in bash)
writes the (0's) timing results .. having to add a redirect to make that
not appear kind of defeats the purpose (no longer an empty command).

That is not actually what interp 267 says it should do, but it's what
bash does. 267 says it's roughly equivalent to `times', which bash has
as a builtin already. The difference is that `times' doesn't look at
$TIMEFORMAT.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Reply via email to