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

Re: dash/bash: exec behaviour change on Buster



On 18/07/19 1:29 PM, John Crawley wrote:
> Hi tomas and Thomas, thanks for your input.
> I think I have a basic idea of what exec does.
> However, try running in a terminal:
> echo $$
> exec <someterminal>
> #Then, in the new terminal:
> echo $$
> 
> The two PIDs are different! (or were here)

Yes. You exec'd a terminal, which then started a shell. You'll probably
find (I did) that the first pid you got is now the pid of the terminal:

richard@zircon:~$ echo $$
18626
richard@zircon:~$ exec xterm

[new terminal]
richard@zircon:~$ echo $$
19317

[trimmed output of ps f]
  PID TTY      STAT   TIME COMMAND
18626 pts/7    Ss+    0:00 xterm
19317 pts/10   Ss     0:00  \_ bash
19449 pts/10   R+     0:00      \_ ps f

Richard

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: