delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/28/11:06:58

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Original-Recipient: <cygwin AT cygwin DOT com>
From: "Hannu E K Nevalainen (garbage mail)" <garbage_collector AT telia DOT com>
To: "ML CygWIN" <cygwin AT cygwin DOT com>
Subject: DOS <-> Bash interaction...
Date: Tue, 28 Jan 2003 17:06:04 +0100
Message-ID: <NGBBLLIAMFLGJEOAJCCECEHOCIAA.garbage_collector@telia.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200

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



-- 8< --- ~/.rm_bc_paths ---
#NOTE: You MUST 'source' this.
#DON'T: !/bin/bash

#This is to remove the Borland compiler paths from PATH
#Install paths can be something like:
#
#	c:\PROGRAM\BC31_DOS\BIN
#	c:\PROGRAM\BC5\BIN
#
# which will contain / instead of \ in bash.
#
#grep PATTERN to look for (and remove)
sd="/bc"


#lets have a copy of the current PATH
echo $PATH 				>/tmp/PATH

#replace :'s with linefeeds
tr ':' '\n' 			</tmp/PATH	>/tmp/PATHLF

#remove lines that contains $sd
grep -v -i "$sd"			</tmp/PATHLF >/tmp/PATH_CLEANLF

#restore : as separator
tr '\n' ':' 			</tmp/PATH_CLEANLF >/tmp/PATH_CLEAN

#set the new clean path
export PATH=`cat /tmp/PATH_CLEAN`

#inform user...
echo "~/.rm_bc_paths: --- Removed these paths --- "
diff /tmp/PATHLF /tmp/PATH_CLEANLF

#cleanup
rm /tmp/PATH*
sd=

-- 8< --


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019