On Sat, Jun 9, 2012 at 10:05 AM, Linda Walsh <bash@tlinx.org> wrote:
>
>
> Pierre Gaston wrote:
>>
>>
>>> trap backtrace ERR
>>> set -T
>>>
>>
>> To sum up ". sdf2" is returning 1
>> Bash considers . to be a simple command even though what's really
>> executed is [[ $# -ge 2 ]] && echo hello.
>
> ---
> Right.... It's NOT a simple command.
>
> I am trapping on ERR, not 'anything' that is not zero.
>
> Of all the stupid definitions... you have 256 useful values to return, and
> some
> idiots decide 255 of them should be reserved for fatal errors (even when
> they are
> not errors)...
>
> Is this even fixable?
Sorry if I was unclear but it is the "." command that causes the
error. If you add "return 0" at the end of sdf2, you will see no
trace.
I would probably consider it a bug if "." was returning 1 without
triggering an error.
Now you could consider a bug to get the "[[ $# -ge 2 ]]" instead of
"." in BASH_COMMAND, though I guess some people might, on the
contrary, find it useful.