home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!coplex!trebor!root
- From: root@trebor.uucp (Bob Stockler)
- Subject: Re: .profile vs. .kshrc
- Organization: Bob Stockler
- Distribution: na
- Date: Sat, 07 Nov 1992 19:13:10 GMT
- Message-ID: <1992Nov07.191310.8478@trebor.uucp>
- References: <Bwwo6r.5CE@constant.demon.co.uk> <Bx5wxp.2oH@constant.demon.co.uk> <1992Nov04.233827.1078@trebor.uucp> <1dea38INN9r8@early-bird.think.com>
- Lines: 33
-
- barmar@think.com (Barry Margolin) writes:
-
- >In article <1992Nov04.233827.1078@trebor.uucp> root@trebor.uucp (Bob Stockler) writes:
- >> If the
- >>ENV environmental parameter is set (and exported) in either "/etc/profile" or
- >>"$HOME/.profile" to contain the full pathname of any file, that file will be
- >>read (and the commands in it executed, as though it were a "dot" file) upon
- >>the invocation of any instance of the KornShell, at any level of subshells
- >>(Bourne or Korn). I have no idea how this relates to C shell users.
-
- >It's not as good as the C shell's .login and .cshrc facility.
-
- The question was "how do you get KornShell alias definitions in subshell
- invocations of "ksh", not "which is your preferred shell".
-
- >The main problem with this Korn Shell feature is that it doesn't provide
- >any way to customize the shell environment in a shell that isn't descended
- >from a login shell. These include the shell in which cron, at, and batch
- >jobs run, and commands executed with rsh/remsh. The C shell always
- >executes the user's .cshrc (unless the "-f" option is specified), so you
- >always get your custom environment.
-
- But you've given the answer for C shell users (I think): set and export
- ENV in "$HOME/.login" (however that's done in the C shell), if they wanna
- execute KornShell scripts in subshells.
-
- As for getting ENV in the environment for 'cron', on my system it can be
- set and exported in the environment in a file in "/etc/rc.d" before the
- 'cron' daemon is started up (if one wanted to do so), and 'at' stuff
- inherits the environment of the invoker. Also, I think passing variable
- assignments on the command line works, so "ENV=/.kshrc /bin/ksh script"
- should put ENV in the environment of a KornShell script to be run.
-
-