starting up a shell
Ron Stanions
sauron at dsoft.UUCP
Fri Jan 5 20:00:09 AEST 1990
In article <1990Jan3.133233.24427 at granite.cr.bull.com>,
freedman at granite.cr.bull.com (Jerome Freedman) writes:
>
> I want to start up a shell (ksh,sh,csh - all, any shell)
> but I want to give it a specially tailored environment. Can
> I get the shell to look at something other than the satandard
> startups - .cshrc,.profile etc when the shell starts?
On my old xenix system, having a '/etc/cshrc' would allow you to define
some presets for a csh environment just like /etc/profile does for a regular
sh or rsh shell on login. I changed opsys's since then and have not
experimented much with the csh setup. Instead, I just append an 'exec csh'
to the end of my own .profile which causes it to immediately spawn a csh
shell on login instead of the sh shell. the advantage to this is each
user can set up his own account first using .profile to set the
variables and all and then spawning the cshell (or kshell or whatever
one you want.) And the system administrator doesn't have to upgrade the
/etc/passwd file to point to the new shell.
the disadvantage is the new shell does not know it's to be considered
the login shell. since you logged in on an sh shell and then spawned
another one. I don't know what it is that defines to a shell whether
it's the login shell or not, but if you use the statement 'exec' then
you can always check the parent process id. if it's a '1', then you can
consider your shell the login shell. That's how I dealt with my
users wanting different login shells.
--
Ron Stanions -- sauron at dsoft \_/\--/\_/ All things posted by me are
dsoft system administrator < \ / > by-products of a deranged mind
Dragonsoft Development \ / from spending too many hours
...!uunet!tronsbox!dsoft!sauron `\oo/' trying to make uucp work!
More information about the Comp.unix.questions
mailing list