bug-bash
[Top][All Lists]
Advanced

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

Re: Logical expressions and job control


From: Martin Schulte
Subject: Re: Logical expressions and job control
Date: Fri, 10 Feb 2023 19:20:07 +0100

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 is because sleep "exits" with an exit status of 148 
(=128+SIGTSTP) when it is stopped. If you replace the && with an ;, you get 
"yes" immediately after pressing ^Z.

Best regards

Martin



reply via email to

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