Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16516

Re: ‘command … &’ creates subshell

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: ‘command … &’ creates subshell
Date 2020-07-01 13:57 -0400
Message-ID <mailman.783.1593626244.2574.bug-bash@gnu.org> (permalink)
References (4 earlier) <7dvoi92p.dag@gnui.org> <09ea84b2-4fb1-6b05-7c0b-fe6b2ab00c6f@archlinux.org> <2643.1593599092@jinx.noi.kre.to> <14637.1593625593@jinx.noi.kre.to> <20200701175717.GJ22833@eeg.ccf.org>

Show all headers | View raw


On Thu, Jul 02, 2020 at 12:46:33AM +0700, Robert Elz wrote:
> POSIX says:
> 
> 	If command is specified, exec shall not return to the shell;
> 
> but in bash...
> 
>  bash
> jinx$ echo $$
> 23361
> jinx$ exec :
> bash: exec: :: not found
> jinx$ echo $$
> 23361

You're in an interactive shell.  Bash chose this behavior to make your
life better.

unicorn:~$ cat foo
#!/bin/bash
exec :
echo "I am still here"
unicorn:~$ ./foo
./foo: line 2: exec: :: not found
unicorn:~$ 

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: ‘command … &’ creates subshell Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-01 13:57 -0400

csiph-web