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


Groups > linux.debian.user > #211495

Re: dash/bash: exec behaviour change on Buster

From Richard Hector <richard@walnut.gen.nz>
Newsgroups linux.debian.user
Subject Re: dash/bash: exec behaviour change on Buster
Date 2019-07-18 08:00 +0200
Message-ID <yl7Cq-7bx-3@gated-at.bofh.it> (permalink)
References <ykNkl-2QL-1@gated-at.bofh.it> <ykNDH-2Xd-1@gated-at.bofh.it> <yl3yO-4ku-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

dash/bash: exec behaviour change on Buster John Crawley <john@bunsenlabs.org> - 2019-07-17 09:50 +0200
  Re: dash/bash: exec behaviour change on Buster <tomas@tuxteam.de> - 2019-07-17 10:20 +0200
    Re: dash/bash: exec behaviour change on Buster "Thomas Schmitt" <scdbackup@gmx.net> - 2019-07-17 10:40 +0200
      Re: dash/bash: exec behaviour change on Buster John Crawley <john@bunsenlabs.org> - 2019-07-18 03:40 +0200
        Re: terminal window returns prompt (was: dash/bash: exec behaviour  change on Buster) John Crawley <john@bunsenlabs.org> - 2019-07-18 05:40 +0200
        Re: dash/bash: exec behaviour change on Buster Richard Hector <richard@walnut.gen.nz> - 2019-07-18 08:00 +0200
          Re: dash/bash: exec behaviour change on Buster John Crawley <john@bunsenlabs.org> - 2019-07-18 09:50 +0200

csiph-web