[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: local failure

From: Dale R. Worley
Subject: Re: local failure
Date: Thu, 28 May 2020 22:43:42 -0400

It's a subtle point.  See this paragraph in the bash manual page:

       If there is a command name left after expansion, execution
       proceeds as described below.  Otherwise, the command exits.  If
       one of the expansions contained a command substitution, the exit
       status of the command is the exit status of the last command
       substitution performed.  If there were no command substitutions,
       the command exits with a status of zero.

In one of your examples, a "local" command is generated using a command
substitution, so the exit status is that of the local command.  In the
other, only an assignment is done, which is not a command, so the exit
status is that of the last command substitution.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]