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
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
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:~$
> >
> > ...
>
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