This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cygwin b20 bash path usage?


---"Pierre A. Humblet" <Pierre.Humblet@eurecom.fr> wrote:
> >
> > At 07:21 PM 11/10/98 -0800, Earnie Boyd wrote:
> > >
> > >No.  The current working directory is only searched if you contain
> a .
> > >(period character) in the PATH variable list.  If you want it to be
> > >searched first then you'll need to place it first in the PATH; but,
> > >this isn't good security practices.
> > >
> > That's not my experience with bash and ash
> > They find commands in the current directory as long as PATH has an
> empty
> > component (or contains .) .
> > ~: cat findit
> > #!/bin/sh
> > echo You found me
> > ~: PATH=/bin
> > ~: findit
> > BASH.EXE: findit: command not found
> > ~: PATH=
> > ~: findit
> > You found me
> > ~: PATH=/bin:
> > ~: findit
> > You found me
> > ~:
> > 
> > Pierre
> > 
> > 
> 
> Is this a documented feature?  If not then it is most likely a bug and
> will stop working this way in some future release?  Of course, it
> could be considered a benefit and then documented also, IMHO it is not
> a good idea to use undocumented features.
> 
> ==
> -                  \\||//
> -------------o0O0--Earnie--0O0o--------------
> --          earnie_boyd@yahoo.com          --
> -- http://www.freeyellow.com/members5/gw32 --
> ----------------ooo0O--O0ooo-----------------
> 

The following is an excerpt taken from the Solaris 2.5 documentation for the standard Bourne shell (sh):

   The shell parameter PATH defines the  search  path  for  the
   directory  containing  the  command.   Alternative directory
   names are separated by a colon (:).   The  default  path  is
   /usr/bin.  The current directory is specified by a null path
   name, which can appear immediately  after  the  equal  sign,
   between  two  colon delimiters anywhere in the path list, or
   at the end of the path list.

This translates to:

PATH=:...
PATH=...::...
PATH=....:

Of course, a DOT could also be placed in the appropriate positions.  This has been standard for sh since the first release I ever worked with, UNIX Seventh Edition, in 1980.  It is also true for KSH and BASH in UNIX environments.

Bob McGowan

-----
See the original message at http://www.egroups.com/list/gnu-win32/?start=9218
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]