rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Peter Koch <pk@TechFak.Uni-Bielefeld.DE>
To: rc@hawkwind.utcs.toronto.edu
Subject: non login "rc" needs customized environment
Date: Wed, 13 Feb 2002 14:21:43 -0500	[thread overview]
Message-ID: <200202131921.UAA01849@grimsvotn.TechFak.Uni-Bielefeld.DE> (raw)


Folks,

this must be a FAQ but since I did not find it in that old collection some of
you may be able to shed some light on the following problem.

We have been using "rc" as default login shell for more than 10 years now
with currently 1000+ users in our department. Every now and then, but
with increasing frequency recently we've felt uncomfortable with "rc"s handling
of $HOME/.rcrc. It's only processed if "rc" is a login shell, which is not
the case if you use rsh/ssh for calling commands on a remote system.
Unfortunately this prevents users from customizing their environment there,
especially the PATH variable.  Calling "rc -l" explicitly, e.g. as in

	rsh foo 'rc -l ' < `{echo cmd}

to enforce .rcrc processing is not always an option. Even worse, when using
CVS you can ask the "cvs" command to use rsh/ssh to transparently check in/out
objects on that remote system, but it needs to be able to find the appropriate
"cvs" commands there, which it can't unless/before the PATH variable is set
accordingly. Now "rc" users seem to lose. (There are similar scenarios, so
a "cvs" only approach doesn't help, and changing the default PATH assignment
also is not an option.)

For these reasons we would like to trim "rc" to enable user environment
customization even if "rc" is not marked as login shell.

"bash" and "tcsh" support SHLVL which can be used to tell apart the top level
(i.e. either login shell or first shell started by rshd/sshd) from any
child or subsequent shell.

So I would like to suggest to add this ``feature'' to "rc", to be activated
optionally at compile time:

1) IF upon startup (SHLVL is not set or does not contain a numeric value)
     OR (shell is marked as login shell)
   THEN SHLVL=1
   ELSE SHLVL++

2) Process $HOME/.rcrc iff (sic!) SHLVL == 1

This may have backward compatibility issues with non-interactive, non-login
top level shells (intentional, see above!) and also non-interactive login
shells.

Changing the code to accomplish this seems not too difficult, but since this is
going to be an architectural change I'd like to learn other's opinions before-
hand. Also, any better approach to the original problem or pointer to an
existing patch would be fine.

Thanks,
  Peter


             reply	other threads:[~2002-02-13 19:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-13 19:21 Peter Koch [this message]
     [not found] <chet@nike.ins.cwru.edu>
2002-02-13 20:36 ` Chet Ramey
2002-02-14  2:16   ` Scott Schwartz
2002-02-14 23:35     ` Markus Friedl
2002-02-15  3:05       ` Scott Schwartz
2002-02-14 13:35 Smarasderagd
2002-02-15  0:37 ` Greg A. Woods
2002-02-14 17:44 Byron Rakitzis
2002-02-15  0:18 ` Dave Mason
2002-02-15  3:21 ` Scott Schwartz
2002-02-15  4:11 Byron Rakitzis
2002-02-15 14:04 ` Tim Goodwin
2002-02-27  1:46   ` callum.gibson
2002-02-27  2:16     ` Chris Siebenmann
2002-02-27 13:32       ` Carlo Strozzi
2002-02-27 13:29   ` Carlo Strozzi
2002-02-27 22:24     ` Matt H
2002-02-27  6:13 ` Derek Fawcus
2002-02-27  0:52 Byron Rakitzis
2002-02-27  6:26 Russ Cox
2002-02-27  6:29 Byron Rakitzis

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=200202131921.UAA01849@grimsvotn.TechFak.Uni-Bielefeld.DE \
    --to=pk@techfak.uni-bielefeld.de \
    --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).