Hello again,

On Sat, Apr 1, 2023, at 18:46, наб wrote:
> a quick skim reveals
> this is because the final pipeline exits 1 because I used a && as an if;

Wow, thank you for noticing that! It makes perfect sense, but I hadn't
considered that particular difference between && and if. From the
The Open Group Base Specifications Shell Command Language chapter:

In 2018, 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_06
 wrote:
> The exit status of an AND list shall be the exit status of the last
> command that is executed in the list.

vs.

In 2018, 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_07
 wrote:
> The exit status of the if command shall be the exit status of the
> then or else compound-list that was executed, or zero, if none was executed.

Thanks!
Scott

Reply via email to