bug-bash
[Top][All Lists]
Advanced

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

Re: nofork command substitution bugs


From: Chet Ramey
Subject: Re: nofork command substitution bugs
Date: Fri, 12 Jan 2024 15:10:22 -0500
User-agent: Mozilla Thunderbird

On 1/12/24 1:06 PM, Oğuz wrote:

Why would that be unexpected, since you're explicitly running something
in the calling shell's context, with the expected side effects to that
environment?

I wasn't clear. This doesn't exit the shell

     bash-5.3$ exec foo
     bash: exec: foo: not found
     bash-5.3$

This does:

     bash-5.3$ : ${ exec foo;}
     bash: exec: foo: not found
     $

Why would you expect either to cause an interactive shell to exit?

Oh, I see, an interactive shell. Think of funsubs in an interactive shell
as being temporarily non-interactive, like when the shell executes
./source. If you source a file from an interactive shell, a failed exec
causes the shell to exit.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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