delorie.com/archives/browse.cgi | search |
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 |
From: | "Lisbeth Kellogg" <lisbeth DOT kellogg AT apioutsourcing DOT com> |
To: | "'Lisbeth Kellogg'" <lisbeth DOT kellogg AT apioutsourcing DOT com>, |
<cygwin AT cygwin DOT com> | |
Subject: | RE: Problem call a cygwin command from a dos batch file |
Date: | Tue, 29 Jul 2003 16:25:58 -0500 |
Message-ID: | <006501c35618$0056d3c0$9901020a@api360.net> |
MIME-Version: | 1.0 |
X-Priority: | 3 (Normal) |
X-MSMail-Priority: | Normal |
Importance: | Normal |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4807.1700 |
In-Reply-To: | <005401c3560c$d9d29a00$9901020a@api360.net> |
X-OriginalArrivalTime: | 29 Jul 2003 21:20:33.0985 (UTC) FILETIME=[3F20B310:01C35617] |
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. --- Lisbeth Kellogg Office: 651-675-2610 -----Original Message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Lisbeth Kellogg Sent: Tuesday, July 29, 2003 3:06 PM To: cygwin AT cygwin DOT com Subject: Problem call a cygwin command from a dos batch file I am having a problem with trying to sort a pipe-delimited file using the cygwin sort command from a dos batch file. If I enter the command in cygwin environment, it works fine: sort -t \| -k 3 -k 11 -k 12 -o sortedfile.txt unsortedfile.txt But I have problems running it from a dos batch file. It appears to work in Windows XP but not in Windows 2000. The command in the batch file is: bash -c "sort -t \| -k 3 -k 11 -k 12 -o sortedfile.txt unsortedfile.txt" In Win XP it executes without a problem, but in Win 2000, I get a message the says, "Input file specified two times," as if it does not recognize the -o option. If I put the sort command in an echo, I get the results I would expect, so the -o is not lost: bash -c "echo sort -t \| -k 3 -k 11 -k 12 -o sortedfile.txt unsortedfile.txt" Rearranging the arguements and adding extra escape characters in various combinations don't seem to help. Any ideas, please? --- Lisbeth Kellogg Office: 651-675-2610 -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |