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: Problem call a cygwin command from a dos batch file


Yes.  Now I get the same thing.  But why don't I have to do it that way
in XP?

---
Lisbeth Kellogg
Office: 651-675-2610
 

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf
Of DePriest, Jason R.
Sent: Tuesday, July 29, 2003 4:48 PM
To: cygwin@cygwin.com
Subject: RE: Problem call a cygwin command from a dos batch file


My /etc/profile (the default one with cygwin) contains this: export
PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
which implies that the behavior you are seeing is to be expected (if you
have the same /etc/profile).

See what happens when I add the '--logon' postfix to 'bash'.

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd cygwin

C:\cygwin>bash -c "echo $PATH"
'bash' is not recognized as an internal or external command, operable
program or batch file.

C:\cygwin>cd bin

C:\cygwin\bin>bash -c "echo $PATH"
/cygdrive/c/Perl/bin/:/cygdrive/c/Perl/bin/:/cygdrive/c/WINNT/system32:/
cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/c/Program
Files/Microsoft SQL Server/80/Tools/BINN:/cygdrive/c/Program
Files/WinZip:/cygdrive/g/Tools/NmapWin/bin:/cygdrive/c
C:\cygwin\bin>bash --login -c "echo $PATH"
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Perl/bin/:/cygdrive/c/Perl/bin/
:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32
/Wbem:/cygdrive/c/Program Files/Microsoft SQL
Server/80/Tools/BINN:/cygdrive/c/Program Files/WinZip:/cygdrive/g/
C:\cygwin\bin>



-----Original Message-----
From: Lisbeth Kellogg [mailto:lisbeth.kellogg@apioutsourcing.com] 
Sent: Tuesday, July 29, 2003 4:40 PM
To: cygwin@cygwin.com
Subject: RE: Problem call a cygwin command from a dos batch file


Yes, that would fix it.  But I think we have a bug here.  In cygwin I
get:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINN
T:/cygdr
ive/c/WINNT/System32/Wbem:/cygdrive/c/Program Files/Microsoft SQL
Server/80/Tool
s/BINN:/cygdrive/c/PROGRA~1/ULTRAE~1:/usr/bin:/cygdrive/c/blat184:/cygdr
ive/c/AP
I360/Programs:/cygdrive/c/Program Files/Adobe/Acrobat
4.0/Distillr:/cygdrive/c/x mlconvert:/cygdrive/c/Program
Files/msxsl:/cygdrive/c/Program Files/PKWARE:/cygd rive/c/Program
Files/PKWARE/PKZIPC:/cygdrive/c/jdk1.3.1_02/bin:/cygdrive/c/TIFFl
Ib

In DOS I get:

C:\WINNT>bash -c "echo $PATH
/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/
Wbem:/cy
gdrive/c/Program Files/Microsoft SQL
Server/80/Tools/BINN:/cygdrive/c/PROGRA~1/U
LTRAE~1:/usr/bin:/cygdrive/c/blat184:/cygdrive/c/API360/Programs:/cygdri
ve/c/Pro
gram Files/Adobe/Acrobat
4.0/Distillr:/cygdrive/c/xmlconvert:/cygdrive/c/Program
 Files/msxsl:/cygdrive/c/Program Files/PKWARE:/cygdrive/c/Program
Files/PKWARE/P KZIPC:/cygdrive/c/jdk1.3.1_02/bin:/cygdrive/c/TIFFlib

They shouldn't be different.

---
Lisbeth Kellogg
Office: 651-675-2610
 

-----Original Message-----
From: Elfyn McBratney [mailto:elfyn@emcb.co.uk] 
Sent: Tuesday, July 29, 2003 4:33 PM
To: Lisbeth Kellogg
Cc: cygwin@cygwin.com
Subject: RE: Problem call a cygwin command from a dos batch file


On Tue, 29 Jul 2003, Lisbeth Kellogg wrote:

> I guess I found the answer to my own question.  Since some other
> people have had this same problem, here is the solution.
> 
> There is a problem with the PATH environment under Win 2000.  To
> identify the problem I typed the following in DOS:
> 
>      bash -c "which sort"
> 
> I got a response of "/cygdrive/c/WINNT/system32/sort" instead of
> "/usr/bin/sort".  This is the DOS sort command, not the cygwin sort 
> command.  I just had to change my command to:
> 
>      bash -c "c:/cygwin/bin/sort -t \| -k 3 -k 11 -k 12 -o
> sortedfile.txt unsortedfile.txt"
> 
> This could be a problem any time the DOS and cygwin commands have the
> same name.

Like find, rexec, ... Having 'C:\Cygwin\bin' at the front of your PATH 
environment variable would have solved this.

Elfyn

-- 
Elfyn McBratney, EMCB  |  http://www.nongnu.org/wwwauth/
http://www.emcb.co.uk  |  http://www.emcb.co.uk/webauth/
elfyn@emcb.co.uk       |  wwwauth-users AT nongnu DOT org


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]