Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!brolga!eric From: eric@brolga.cc.uq.oz.au (Eric Halil) Newsgroups: comp.unix.shell Subject: How does the ksh ENV "trick" work? Message-ID: <1991May27.054451.24232@brolga.cc.uq.oz.au> Date: 27 May 91 05:44:51 GMT Organization: Prentice Computer Centre, The University of Queensland, Australia. Lines: 12 In "The Kornshell Command and Programming Language" by Morris I. Bolsky and David G. Korn, Prentice-Hall, 1989, ISBN 0-13-516972-0, page 78 they give: export FILE=$HOME/.kshrc # The subscript below evaluates to 0 when interactive. ENV='${FILE[(_$-=0)+(_=1)-_${-%%*i*}]}' as a easy way to stop your .kshrc being evaluated when it's an not an interactive shell. Can someone explain in detail how this works? Thanks, Eric (eric@cc.uq.oz.au)