Mail Archives: cygwin/1998/11/17/00:48:33
Creating a function called vi will work around the problem, as shown below,
because the path to the script is specified.
$ function vi () { /d/Mentor/Bin/vi ; }
$ type -a vi
vi is a function
vi ()
{
/d/Mentor/Bin/vi
}
vi is /d/Mentor/Bin/vi
vi is /d/Mentor/Bin/vi
But this digresses from the problem. The problem is there is a bug in bash
in it's handling of the command line and executing scripts. I cannot afford
to have to create a function wrapper for every possible script I may want to
execute.
Austin David France
Mentor Systems plc
mailto:adf AT mentor-systems DOT com
> -----Original Message-----
> From: Earnie Boyd [mailto:earnie_boyd AT yahoo DOT com]
> Sent: 13 November 1998 12:20
> To: Austin David France
> Subject: RE: B20 & bash 2.02.1(2) broken
>
>
>
> Interesting. I wonder what would happen if you created a bash
> function named vi?
>
> General syntax is:
>
> function vi {
> COMMANDS
> }
>
> Caution: You can create circular dependencies which will hang bash
> every time.
>
> ---Austin David France <adf AT mentor-systems DOT com> wrote:
> >
> > $ type -a vi
> > bash: type: vi: not found
> > $ chmod +x /d/Mentor/Bin/vi
> > $ type -a vi
> > vi is /d/Mentor/Bin/vi
> > vi is /d/Mentor/Bin/vi
> > $ vi /tmp/oz
> > (hangs, ^C aborts)
> >
> > vi is a script that starts
> >
> > #!/bin/bash
> > echo "vi"
> > set -x
> > cmd="${MEDITOR:-vim}"
> >
> > It matters not what the #!/bin/<shell> is, (tried sh, ksh and bash)
> if it
> > points to a valid shell, it hangs. If the #! line is missing
> (blank) or a
> > silly shell name is put in, for
> > example #!/bin/winkle then bash reports
> >
> > bash: /d/Mentor/Bin/vi: No such file or directory
> >
> > which is to be expected.
> >
> > Some more tests with interesting results
> >
> > $ cd /d/Mentor/Bin
> > $ ln -s vi viabcd
> > $ cp vi viabcdef
> > $ chmod +x *vi*
> > $ vi
> > (hangs)
> > $ vi viabcdef
> > (throws me into vi)
> > $ viabcdef
> > (throws me into vi on no file)
> > $ vi a
> > (hangs)
> > $ vi winkle
> > (hangs)
> > $ vi viwinkle
> > (throws me into vi)
> > $ vi xxwinkle
> > (throws me into vi)
> > $ vi winklexx
> > (theows me into vi)
> > $ vi # hello this is a comment
> > (hangs)
> > $ vi hello this is a comment
> > (throws me into vi on files "hello", "this", "is" and so on)
> >
> > It has to be something to do with the length of the command + it's
> > arguments.
> >
> > Austin David France
> > Mentor Systems plc
> > mailto:adf AT mentor-systems DOT com
> >
> >
> > > -----Original Message-----
> > > From: Earnie Boyd [mailto:earnie_boyd AT yahoo DOT com]
> > > Sent: 12 November 1998 12:08
> > > To: Austin David France
> > > Subject: RE: B20 & bash 2.02.1(2) broken
> > >
> > >
> > >
> > >
> > > What does the bash command `type -a vi' show? Is it possible that
> > > you're picking up the wrong version of vi?
> > >
> > >
> > > ---Austin David France <adf AT mentor-systems DOT com> wrote:
> > > >
> > > > No joy, exactly the same problem. uname -a reports
> > > >
> > > > CYGWIN_NT-4.0 MENPC1 20.0 (0.1/1/1) -11-8 11:59:08
> i486 unknown
> > > >
> > > > I'm guessing the -11-8 is based upon build date of the DLL (8
> Nov 98).
> > > >
> > > > For example, I just tried
> > > >
> > > > $ vi /tmp/oz
> > > > (hangs, ^C aborts)
> > > > $ export PATH=/bin:/mentor/bin:/usr/local/bin
> > > > $ vi /tmp/oz
> > > > /mentor/bin/: /mentor/bin/: Permission Denied
> > > > $ /mentor/bin/vi /tmp/oz
> > > > (throws me into vim as expected)
> > > >
> > > > A find of cygwin find no other cygwin dll's in the path. My
> > > cygwinb19.dll
> > > > is a copy of the new b20 dll.
> > > > Austin David France
> > > > Mentor Systems plc
> > > > mailto:adf AT mentor-systems DOT com
> > > >
> > > <snip>
> > >
> > > ==
> > > - \\||//
> > > -------------o0O0--Earnie--0O0o--------------
> > > -- earnie_boyd AT yahoo DOT com --
> > > -- http://www.freeyellow.com/members5/gw32 --
> > > ----------------ooo0O--O0ooo-----------------
> > >
> > > PS: Newbie's, you should visit my page.
> > > _________________________________________________________
> > > DO YOU YAHOO!?
> > > Get your free @yahoo.com address at http://mail.yahoo.com
> > >
> > >
> > >
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > The views and opinions expressed in this e-mail message are the
> sender's
> > and do not necessarily represent the views of Mentor Systems plc.
> >
> >
> ------------------------------------------------------------------------
> >
> >
> >
>
> ==
> - \\||//
> -------------------o0O0--Earnie--0O0o-------------------
> -- earnie_boyd AT yahoo DOT com --
> -- http://www.freeyellow.com/members5/gw32/index.html --
> ----------------------ooo0O--O0ooo----------------------
>
> PS: Newbie's, you should visit my page.
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
------------------------------------------------------------------------
The views and opinions expressed in this e-mail message are the sender's
and do not necessarily represent the views of Mentor Systems plc.
------------------------------------------------------------------------
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -