Conditional setting of ENV in ksh - Question of how to

Eduardo Krell ekrell at hector.UUCP
Fri Aug 19 07:02:30 AEST 1988


In article <3790 at pbhyf.PacBell.COM> rob at pbhyf.UUCP writes:

>export START ENV
>START=$HOME/.kshrc		# Name of file with aliases, functions
>				# for interactive ksh invocations only
>ENV='${START[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'

I do it in a more readable way. In my ENV file I have:

case $- in
	*i*) ...
	     ...
esac

Where "..." represents whatever you want your interactive shell
to execute.
This way, you'll execute "..." only when $- (ksh's invocation flags)
contains an "i" (for interactive shell).
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell at ulysses.att.com



More information about the Comp.unix.wizards mailing list