This is the mail archive of the cygwin@cygwin.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]
Other format: [Raw text]

Re: DOS <-> Bash interaction...


Looks like no one read Hannu's email, including Hannu! ;-)

The output included clearly shows that his Cygwin installation
contains the default path setting from /etc/profile.  Cygwin paths
are first.  There override the Windows path.  The Windows 'find' 
*is* hidden by the Cygwin version (see below).  So are other like 
named facilities.  That's why the Cygwin installation constructs 
the path this way.  While Hannu prescribes this as a viable option, 
it would appear that he didn't recognize that this was the option 
being used before posting, since his email states that Cygwin does
exactly the oppposite with the path.  It does not.

Larry

Original Message:
-----------------
From: Igor Pechtchanski pechtcha@cs.nyu.edu
Date: Tue, 28 Jan 2003 11:50:55 -0500 (EST)
To: cygwin@cygwin.com
Subject: Re: DOS <-> Bash interaction...


Umm, I don't think this is dependent on the Windows version...  My
(mostly standard, slightly edited) /etc/profile *prepends*
"/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/X11R6/bin" to the
PATH...  Yours probably does too.  Thus, /bin/find.exe should hide
/cygdrive/c/WINDOWS/COMMAND/find.exe (which your cygcheck output snippet
confirms).

You can always check which program will be invoked by typing "type -a
programname" in bash.  For "find.exe" you should get something like:

	$ type -a find.exe
	find.exe is /usr/bin/find.exe
	find.exe is /bin/find.exe
	find.exe is /cygdrive/c/WINDOWS/COMMAND/find.exe

If you get something different as the first entry, your /etc/profile does
*append* the standard paths to the contents of $PATH.  This means you've
probably changed it at some point in the past.  Change it back.
	Igor

On Tue, 28 Jan 2003, Hannu E K Nevalainen (garbage mail) wrote:

> NOTE: Running Win98SE
> Don't know how this affects Win<Other>
>
> on 2002-12-25 at 13:37 i wrote about a problem with $SHELL versus 'startx'
> i.e: startx won't work if $SHELL contains 'command.com' (or any DOS-stuff
> maybe?). The contents of DOS-$SHELL gets copied into bash-$SHELL -> not
> good.
>
> There is another similar problem that might be hard to cope with too:
>
>  As one starts bash it apparently:
>         - copies the DOS/WIN - "$PATH" contents,
>         - puts them in bash-$PATH and then
>         - appends any new stuff
>
>  I'm not sure this behaviour is 'good'. Cause:
>         1. there is a 'find.exe' in C:\windows\command\
>            bash should have problems locating '/usr/bin/find'
>         2. If you have almost any compiler installed there
>            will be a 'cpp' and 'make' in one of them' paths.
>
> This is reflected by, e.g: $ cygcheck -s -v -r
> ...
> Found: c:\PROGRAM\BC31_DOS\BIN\cpp.exe
> Warning: C:\Program\cygwin\bin\cpp.exe hides
c:\PROGRAM\BC31_DOS\BIN\cpp.exe
> Found: c:\PROGRAM\BC5\BIN\cpp.exe
> Warning: C:\Program\cygwin\bin\cpp.exe hides c:\PROGRAM\BC5\BIN\cpp.exe
> Found: C:\Program\cygwin\bin\find.exe
> Found: c:\WINDOWS\COMMAND\find.exe
> Warning: C:\Program\cygwin\bin\find.exe hides c:\WINDOWS\COMMAND\find.exe
> ...
> Found: C:\Program\cygwin\bin\make.exe
> Found: c:\PROGRAM\BC31_DOS\BIN\make.exe
> Warning: C:\Program\cygwin\bin\make.exe hides
> c:\PROGRAM\BC31_DOS\BIN\make.exe
> Found: c:\PROGRAM\BC5\BIN\make.exe
> Warning: C:\Program\cygwin\bin\make.exe hides c:\PROGRAM\BC5\BIN\make.exe
> ...
>
> Suggested remedy:
>  a) make the DOS-PATH contents appear (or be searched) LAST in bash-PATH
>  b) DON'T copy DOS-PATH contents at all
>  c) Have DOS-PATH appear as MSDOSPATH in bash, have bash use it.
>
>  d) temporary solution below (add "source ~/.rm_bc_paths" to ~/.profile)
>     NOTE1: simple commented script to make the *problem* clear.
>     NOTE2: The script contains MY PERSONAL installation paths (not the
> defaults)
>
> /Hannu E K Nevalainen, Mariefred, Sweden
>
> [~/.rm_bc_paths snipped]

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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