help-bash
[Top][All Lists]
Advanced

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

Re: weird interaction between builtin cat and trap


From: Peng Yu
Subject: Re: weird interaction between builtin cat and trap
Date: Tue, 19 Apr 2022 11:30:16 -0500

https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

That is what is written in the bash manual. "When a command terminates
on a fatal signal whose number is N, Bash uses the value 128+N as the
exit status."

I think that you should be aware of it?

On 4/18/22, Chet Ramey <chet.ramey@case.edu> wrote:
> On 4/15/22 2:38 PM, Peng Yu wrote:
>
>
>
>> I forgot to mention the exit status. Here are the status of the above
>> command.
>>
>> $ declare -p PIPESTATUS
>> declare -a PIPESTATUS=([0]="141" [1]="1" [2]="0")
>>
>> Here is that of external cat. The error should be catched in the exit
>> status as 141 instead of printing an error message and return 1.
>
> You know this is the same thing again, right? Why is a particular exit
> status a requirement for your use case?
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>


-- 
Regards,
Peng



reply via email to

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