freedman@granite.cr.bull.com (Jerome Freedman) (01/03/90)
I want to start up a shell (ksh,sh,csh - all, any shell) but I want to give it a specially tailored environment. Ca I get the shell to look at something other than the satandard startups - .cshrc,.profile etc when the shell starts? Jerry Freedman
cpcahil@virtech.uucp (Conor P. Cahill) (01/04/90)
In article <1990Jan3.133233.24427@granite.cr.bull.com>, freedman@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. Ca > I get the shell to look at something other than the satandard > startups - .cshrc,.profile etc when the shell starts? For the ksh you can set the environment variable ENV to point to the startup file you want. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+
sauron@dsoft.UUCP (Ron Stanions) (01/05/90)
In article <1990Jan3.133233.24427@granite.cr.bull.com>, freedman@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@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!
maart@cs.vu.nl (Maarten Litmaath) (01/06/90)
In article <1990Jan3.133233.24427@granite.cr.bull.com>, freedman@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. Ca
\I get the shell to look at something other than the satandard
\startups - .cshrc,.profile etc when the shell starts?
csh:
csh -fc 'source startupfile; command'
sh:
.profile isn't executed at all
--
1755 EST, Dec 14, 1992: Henry Spencer is put on a one-way mission to the moon.|
Maarten Litmaath @ VU Amsterdam: maart@cs.vu.nl, uunet!mcsun!botter!maart