On Fri, Dec 25, 2020 at 10:40:17AM +0100, Markus Elfring wrote: > Hello, > > I am looking for another bit of clarification according to an implementation > detail. > > The manual is providing the following information. > https://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1?id=76404c85d492c001f59f2644074333ffb7608532#n627 > > “… > If a command is terminated by the control operator &, the shell > executes the command in the background in a subshell. The shell does not > wait for the command to finish, and the > return status is 0. > …” > > > Thus I observe a behaviour like the following for a simple test with the > software “bash 5.0.18-3.1” according to a “program” which does not exist here. > > elfring@Sonne:~> xy & > [1] 4063 > xy: Befehl nicht gefunden > [1]+ Exit 127 xy > > > I imagine that it can be occasionally helpful to determine the execution > failure > in the synchronous way. > Would it make sense to configure the error reporting for selected asynchronous > commands so that they would become background processes only after the > required > check for executability?
How would you propose that the shell handle something like the following? ( cmd1 && cmd2 ) & Are you maybe saying cmd & should be a special case? -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .