Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!bfmny0!tneff From: tneff@bfmny0.UUCP (Tom Neff) Newsgroups: comp.bugs.sys5 Subject: Re: ksh bugs Keywords: ksh Message-ID: <14579@bfmny0.UUCP> Date: 22 Aug 89 14:08:38 GMT References: <10166@fluke.COM> <10450@fluke.COM> <177@uci.UUCP> <1035@virtech.UUCP> <14571@bfmny0.UU.NET> <1170@vsi.COM> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Distribution: na Organization: ^ Lines: 25 In article <1170@vsi.COM> friedl@vsi.COM (Stephen J. Friedl) writes: >In article <14571@bfmny0.UU.NET>, tneff@bfmny0.UU.NET (Tom Neff) writes: > >> export ENV='${Envfile[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}' > >Hey, cool! I didn't know that ksh had a built-in APL interpreter! > >P.S. - or is that sed script? Actually it's a subscript expression, which evaluates to either $Envfile or the null string depending on whether $- (the current flags) has an "i" (for interactive) in it or not. Admittedly it looks like gobbledygook. But it also shows how cute you can get in Korn shell. If I hadn't seen the expression my .profile would say case $- in *i*) export ENV=$Envfile ;; *) export ENV="" ;; esac In fact it probably should anyway. :-) -- "We walked on the moon -- (( Tom Neff you be polite" )) tneff@bfmny0.UU.NET