[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rsh and (lack of) startup files



My favorite strategy for making rshd shells run a startup script is a
variation on the common hack of making a symbolic link with an explicit
minus (e.g., ln -s /usr/local/bin/es /usr/local/bin/-es).

The link trick works, but with two little flaws:
  1. SHELL is /usr/local/bin/-es, so when invoked by vi or whatever, it's 
     still a login shell.
  2. The error messages look awful, like `` --es: directory not found ''

So I wrote up a small C program.  It fixes SHELL, and puts the minus only in
argv[0].  I can send it, if anyone wants, but it's probably more fun to write
it yourself, just a few lines of code wrapped around an execve(2).

Of course this means that in anticipation of being invoked as a login shell
in a non-interactive situation, the .esrc needs to test accordingly.

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