ksh bugs

Tom Neff tneff at bfmny0.UUCP
Wed Aug 23 00:08:38 AEST 1989


In article <1170 at vsi.COM> friedl at vsi.COM (Stephen J. Friedl) writes:
>In article <14571 at bfmny0.UU.NET>, tneff at 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 at bfmny0.UU.NET



More information about the Comp.bugs.sys5 mailing list