Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!ctisbv!pim From: pim@cti-software.nl (Pim Zandbergen) Newsgroups: comp.unix.questions Subject: Re: How to prevent execution of $ENV file in Korn shell scripts ? Keywords: Korn shell environment Message-ID: <1990Oct4.203833.1809@cti-software.nl> Date: 4 Oct 90 20:38:33 GMT References: <392@nwnexus.WA.COM> Organization: CTI Software BV, The Hague, The Netherlands Lines: 22 golder@nwnexus.WA.COM (Warren Jones) writes: >A related question: When working on an HP-UX system a while back, >I remember seeing in one of the manuals a trick for defining ENV >so that the variable expands to the desired file name for interactive >shells, but to a null string if the shell is not interactive. >NOTE: this is a different question, and does involve efficiency >(though I'm sure not in any critical way). After all, you don't >need to read the ENV file when the shell is simply being used >to glob some file names for an editor. The trick involved checking >the "$-" flags variable for the presence of the letter "i" >(indicating an interactive shell). I remember marveling at the >time how wonderfully obscure and arcane it was, but I can't quite >seem to reproduce it. Can anyone out there provide the answer? [[ ${-} = *i* ]] || ENV= -- Pim Zandbergen domain : pim@cti-software.nl CTI Software BV uucp : uunet!mcsun!hp4nl!ctisbv!pim Laan Copes van Cattenburch 70 phone : +31 70 3542302 2585 GD The Hague, The Netherlands fax : +31 70 3512837