Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ncar!gatech!ulysses!hector!ekrell
From: ekrell@hector.UUCP (Eduardo Krell)
Newsgroups: comp.unix.wizards
Subject: Re: Conditional setting of ENV in ksh - Question of how to
Message-ID: <10519@ulysses.homer.nj.att.com>
Date: 18 Aug 88 21:02:30 GMT
References: <3790@pbhyf.PacBell.COM>
Sender: netnews@ulysses.homer.nj.att.com
Reply-To: ekrell@hector.UUCP (Eduardo Krell)
Organization: AT&T Bell Laboratories
Lines: 21

In article <3790@pbhyf.PacBell.COM> rob@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@ulysses.att.com