home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / question / 13100 < prev    next >
Encoding:
Text File  |  1992-11-08  |  2.1 KB  |  45 lines

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