Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!lll-winken!lll-tis!ames!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!pdg
From: pdg@hpcupt1.HP.COM (Paul Gootherts)
Newsgroups: comp.sys.amiga
Subject: Re: Grow your own VI (Re: AVI editor)
Message-ID: <6080005@hpcupt1.HP.COM>
Date: 19 Aug 88 17:52:22 GMT
Article-I.D.: hpcupt1.6080005
References: <2424@sugar.uu.net>
Organization: Hewlett Packard, Cupertino
Lines: 21

>	What is *really* gross (IMHO) is that the way the same program
>	funtions as three different ones (according to our local Unix
>	expert) is by checking to see argv[0] to see what name the user
>	invoked the program as.  Then the program goes into one of its
>	modes:  vi mode, ex mode, view mode, etc.  Pretty sneaky.

When I first heard this, I assumed vi compared argv[0] against strings
like "vi", "ex", "view", and the like.  I was wrong.  It's worse.  The
version I saw set the mode flags based on characters appearing anywhere
in the name.

Thus, if the name contains a 'w', readonly mode is assumed.  If a 'd'
appears, it assumes you ran "edit", and if a 'v' appears, it assumes
visual mode.

It should be possible to get some weird combinations by making some
other links to the executable, for example, "dvw"....

__________________
Paul Gootherts
Hewlett Packard Co
hplabs!hpda!pdg