rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Donn Cave <donn@u.washington.edu>
To: rc@hawkwind.utcs.toronto.edu
Subject: Re:  subshell, interactive, login, etc
Date: Thu, 25 Jun 1992 21:41:59 -0400	[thread overview]
Message-ID: <9206260141.AA07285@carson.u.washington.edu> (raw)

| Every rc sources .rcrc, but before doing this defines
| certain variable (say $mode) to have certain values
| depending on the mode. 
|
| Then you can do in .rcrc:
|
|   switch ($mode){
|     case login;  . $home/rc/login;
|     case inter;  . $home/rc/inter;
|     case inter_login; . $home/rc/inter; . $home/rc/login;
|   }

I think something like this is needed, recognizing that as we find more
alternatives to the console login, properly initializing a new shell process
becomes more complex.

I think I recall that the original inspiration for this was an stty(1)
needed for a new xterm-invoked rc; this process will inherit environment
variables, so you wouldn't want to set "path" and so forth as if it were
a login, but you wouldn't want to have every interactive rc process run
stty(1).

The easiest and most general way to handle this one might be to use the
ENV concept from ksh.  Window managers and the like could set
ENV = $home/newtty.rc, and that script would be responsible for clearing
ENV so that further rc's aren't plagued by it.  ENV would normally not
be set, so rc scripts wouldn't source anything at all, but it would probably
be good to insure that by having non-interactive shells ignore ENV.

I've complained in the past that rshd invokes one's shell without the
leading minus sign that would make it a login shell, so .rcrc (or .profile,
or whatever) doesn't get run.  This makes it hard to invoke something
that's not in a system standard execution path, via rsh.

There may be no good way to fix that problem, but the best of the bad ways
might be to have rc expect a certain environment variable, and run .rcrc
if it's not there.

	Donn Cave, University Computing Services, University of Washington
	donn@cac.washington.edu


             reply	other threads:[~1992-06-26  1:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-06-26  1:41 Donn Cave [this message]
1992-06-26  2:07 ` Scott Schwartz
1992-06-26  8:10 ` Matthew Farwell
  -- strict thread matches above, loose matches on Subject: below --
1992-06-26 13:57 Matthew Farwell
1992-06-26 10:33 malte
1992-06-26  3:57 Alan Watson
1992-06-26  0:26 D. Borkovic
1992-06-26  0:42 ` Scott Schwartz
1992-06-26  1:39 ` Chris Siebenmann

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=9206260141.AA07285@carson.u.washington.edu \
    --to=donn@u.washington.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).