home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3920 < prev    next >
Encoding:
Internet Message Format  |  1992-09-12  |  1.0 KB

  1. From: wolf@hp-ptp.ptp.hp.com (Paul Wolf)
  2. Date: Sat, 12 Sep 1992 00:33:38 GMT
  3. Subject: Re: KSH: how to stop $ENV
  4. Message-ID: <12510003@hp-ptp.ptp.hp.com>
  5. Organization: HP Pacific Technology Park - Sunnyvale, Ca.
  6. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!scd.hp.com!hplextra!hpcc05!hp-ptp!wolf
  7. Newsgroups: comp.unix.shell
  8. References: <1992Sep11.132901.26395@bnr.ca>
  9. Lines: 23
  10.  
  11.  
  12. Scott Pace of Bell Northern Research writes:
  13.  
  14.  > I have a shell script written in ksh (i.e. has #! /bin/ksh at the start).
  15.  > How do I prevent the ksh from executing $ENV?  This is on HP-UX 7.05.  I
  16.  > have read the man page, and I don't see any switches that would do this.
  17.  > What I really want is the equivalent of the -f switch in the csh.
  18.  > 
  19.  > Thanks.
  20.  
  21.  How about - 
  22.    $ ENV=  ksh script-file
  23.  
  24.  which will modify the variable ENV before executing the script in a 
  25.  subshell.
  26.  
  27.  This is equivalent to - 
  28.  
  29.    $ (export ENV; ENV=  ksh script-file) 
  30.   
  31. -----
  32. Paul Wolf, wolf@hpams0h.ptp.hp.com
  33. Hewlett Packard, Integrated Systems Division, 1266 Kifer Rd, Sunnyvale, CA
  34.