From: Matthew Farwell <dylan@ibmpcug.co.uk>
To: donn@u.washington.edu
Cc: rc@hawkwind.utcs.toronto.edu
Subject: Re: subshell, interactive, login, etc
Date: Fri, 26 Jun 1992 04:10:22 -0400 [thread overview]
Message-ID: <9206260910.aa07929@kate.ibmpcug.co.uk> (raw)
In-Reply-To: <9206260141.AA07285@carson.u.washington.edu>
In article <9206260141.AA07285@carson.u.washington.edu> you write:
>| 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.
; ls -l /bin/rc /bin/-rc
-rwxr-xr-x 3 bin bin 63660 Feb 19 13:17 /bin/-rc*
-rwxr-xr-x 3 bin bin 63660 Feb 19 13:17 /bin/rc*
; fn rc { mode=subshell -rc $* }
Then put something like
if (! $mode ~ subshell) {
test -f $MAIL && echo You have mail.
} else {
prompt=('subshell; ' '>')
}
in your .rcrc. Well, that will work when you do it interactively
anyway.
Dylan.
--
It is no coincidence that in no known language does the phrase 'As
pretty as an Airport' appear -- Douglas Adams
next prev parent reply other threads:[~1992-06-26 8:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-06-26 1:41 Donn Cave
1992-06-26 2:07 ` Scott Schwartz
1992-06-26 8:10 ` Matthew Farwell [this message]
-- 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=9206260910.aa07929@kate.ibmpcug.co.uk \
--to=dylan@ibmpcug.co.uk \
--cc=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).