rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: quanstro@stolaf.edu (Erik Quanstrom)
To: rc@hawkwind.utcs.toronto.edu
Subject: re: $pid
Date: Thu, 4 Jun 1992 08:14:19 -0400	[thread overview]
Message-ID: <9206041214.AA04151@stolaf.edu> (raw)

Malte (9206041005.AA01785@dahlie.techfak.uni-bielefeld.de> writes
>I don't think echo `{ echo $pid } should be different from echo $pid because
>I don't really want know that backquote substitution requieres a fork(2).
>Of course, shell functions and explicit subshell commands "@{ .. }" should.

$Pid should always mean the _current_ pid (as per the td's paper and
rc's man page), whatever the implementation demands that that me. If
this is not the case, then a script like

	@{ kill -9 $pid }

will _not_ behave like a seperate shell, the whole idea behind @ ...
in the first place. This is bad.

As to the case of backquoting it seems to me a little less clear that
changing the pid is the right thing to do. But I still have several
reasons for wanting $pid to change. First inconsistency is not a nice
thing. Second, it eliminates the difference between the percieved [sic?]
behavior of 

	echo `{exit}						(1)

which does _not_ kill the shell and 

	echo `{kill -9 $pid}					(2)

which does. Such quirks are really not nice to have around: they cause
confusion and cause too much dependence on implementation. Consider an
implementation which did not fork (perhaps in the Plan 9 environment).

Perhaps $parent should be introduced, being the pid of the rc which is
forking off this, that and the other thing. But to be honest, I am not
yet clear how to resolve all the complecations of this.




             reply	other threads:[~1992-06-04 12:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-06-04 12:14 Erik Quanstrom [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-06-04 17:01 $pid haahr
1992-06-04 16:57 $pid haahr
     [not found] <cks@hawkwind.utcs.toronto.edu>
1992-06-04 10:05 ` $pid malte
1992-06-03 23:17 $pid Erik Quanstrom
1992-06-03 23:49 ` $pid Chris Siebenmann
1992-06-05  1:16 ` $pid John Mackin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9206041214.AA04151@stolaf.edu \
    --to=quanstro@stolaf.edu \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).