home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
- From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
- Subject: Re: KSH: how to stop $ENV
- Message-ID: <mcook.716248461@fendahl.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fendahl.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- References: <1992Sep11.171131.29549@u.washington.edu> <1992Sep11.175318.3198@bnr.ca>
- Date: Fri, 11 Sep 1992 21:54:21 GMT
- Lines: 33
-
- space%bnr.ca (Scott Pace) writes:
-
- >Donn Cave (donn@carson.u.washington.edu) wrote:
- >: space%bnr.ca (Scott Pace) writes:
- >:
- >: | I have a shell script written in ksh (i.e. has #! /bin/ksh at the start).
- >: | How do I prevent the ksh from executing $ENV? This is on HP-UX 7.05. I
- >: | have read the man page, and I don't see any switches that would do this.
- >: | What I really want is the equivalent of the -f switch in the csh.
- >:
- >: #!/bin/ksh -p
- >:
- >: But, don't be surprised if it doesn't work! It works on some Korn shells,
- >: not others. It's generally not documented, may be obsolete. I'd like to
- >: know - I think it's a valuable feature. (It's not the same as expecting your
- >: users to use the bizarre interactive-only formula for ENV.)
- >:
-
- >But I can't use -p since it clobbers the $PATH variable, and I need that to
- >be kept intact.
-
- If $PATH is being clobbered, it is probably being done in /etc/suid_profile.
-
- How about replacing
-
- #! /bin/ksh
-
- with
-
- #! /bin/sh
- case "$RANDOM" in '') ENV= ; exec /bin/ksh $0 ${1+"$@"} ;; esac
-
- Michael.
-