Re: Logical expressions and job control

2023-02-13 Thread Chet Ramey
On 2/10/23 1:10 PM, Godmar Back wrote: Hi, the students in my Systems course are currently working on their shell assignment and of course are giving bash a spin to compare features. One student pointed out that logical expressions such as `a` && `b` in bash don't seem to work when `a` is stoppe

Re: Logical expressions and job control

2023-02-10 Thread Andreas Schwab
On Feb 10 2023, Godmar Back wrote: > It appears to be mistaking the wait status for the exit status if your > hypothesis is correct. Easy to verify: $ sleep 10 && echo yes || echo $? ^Z [1]+ Stopped sleep 10 148 -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 75

Re: Logical expressions and job control

2023-02-10 Thread Godmar Back
Hi Martin, thank you for your response. On Fri, Feb 10, 2023 at 1:20 PM Martin Schulte wrote: > Hi Godmar! > > > For instance: > > > > gback@lat2022:~$ sleep 10 && echo yes > > ^Z > > [1]+ Stopped sleep 10 > > gback@lat2022:~$ fg > > sleep 10 > > gback@lat2022:~$ > > > > ... >

Re: Logical expressions and job control

2023-02-10 Thread Martin Schulte
Hi Godmar! > For instance: > > gback@lat2022:~$ sleep 10 && echo yes > ^Z > [1]+ Stopped sleep 10 > gback@lat2022:~$ fg > sleep 10 > gback@lat2022:~$ > > ... > > What's the rationale for bash's behavior in this case and is this something > that should be changed? I assume this