delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:message-id:date:from:mime-version:to:subject | |
:references:in-reply-to:content-type:content-transfer-encoding; | |
q=dns; s=default; b=O68h7rCOlh9zCENh5aESQ3xNwVEIccZqan0y//cFoPZ | |
dLPQX8XPvAJXpURJVws1nXt5GVVzaG69EU1qaEiZPfIuE3zsapygio3KCEk8hK4D | |
8QaCD8SNBQ9DLIeWhwGI77LRQb+eXiNsBaCmod6OnN87PRhzxxEuQbjgnSSuvpJ0 | |
= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:message-id:date:from:mime-version:to:subject | |
:references:in-reply-to:content-type:content-transfer-encoding; | |
s=default; bh=E/msEVgxW2KFXSZn5NzLTZenAQ4=; b=txmPQ8PtrKsoRpJtB | |
YCpL1IPsF0zfyAB+KAocJWrOJRkHt7/GondvBEHPB1R2TqqeJb7uMHqQ/87U9izm | |
e257GQ8EzHWtPEJkie4ScSV7VF9WUaER7RWCjotfuJlKOAfWnCkHTJX6xPiybUJq | |
itwU4aScTPNJmd8xHGpwSwjXFk= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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 |
Authentication-Results: | sourceware.org; auth=none |
X-Spam-SWARE-Status: | No, score=-1.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 |
X-HELO: | smtp.smtpout.orange.fr |
Message-ID: | <5251240C.6060805@easynet.fr> |
Date: | Sun, 06 Oct 2013 10:49:16 +0200 |
From: | Francis ANDRE <francis DOT andre AT easynet DOT fr> |
User-Agent: | Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
MIME-Version: | 1.0 |
To: | francis DOT andre DOT kampbell AT orange DOT fr, cygwin AT cygwin DOT com |
Subject: | Re: 1.7.25: problem with the cd command in ksh |
References: | <524FB2BB DOT 40608 AT orange DOT fr> <CAM9pMnMcQcp4prHqs5Bh1sCt0HGC1zaTcmHEXFPrj_+3ZffjmA AT mail DOT gmail DOT com> <52512348 DOT 1050702 AT orange DOT fr> |
In-Reply-To: | <52512348.1050702@orange.fr> |
Hi Robert The problem here is that the string of the target directory is computed by another tool -- Mercurial in this case -- and that Mercurial returns a absolute windows style path as Z:/DEV/OpenJDK_7u40/hotspot which seems to be relative in Unix world but which is absolute in the Windows world. Moreover, when using the bash shell, the command FrancisANDRE AT idefix /cygdrive/c/Cygwin $ cd Z:/DEV/OpenJDK_7u40/hotspot moves the cwd without error to FrancisANDRE AT idefix /cygdrive/z/DEV/OpenJDK_7u40/hotspot So why the ksh cannot do the same? Francis Le 05/10/2013 12:22, Robert Klemme a écrit : > On Sat, Oct 5, 2013 at 8:33 AM, Francis ANDRE > <francis DOT andre DOT kampbell AT orange DOT fr> wrote: >> Hi Cygwin List >> >> I have a problem with the cd command in a ksh script. In the log below, >> there is this error: >> /make/scripts/webrev.ksh[2899]: cd: >> /cygdrive/z/DEV/OpenJDK_7u40/hotspot/Z:/DEV/OpenJDK_7u40/hotspo >> t/make/windows/makefiles: No such file or directory >> >> and the snippet producing this error is >> >> # cd to the directory so the names are short >> echo "=============================1" CWW=$CWS DIR=$DIR >> VARRR=$CWS/$DIR >> echo "=============================2" VARR=$VARRR >> cd "$VARRR" >> echo "=============================3" $CWS/$DIR >> >> So it seems that the cd command is prepending the target directory where to >> go(Z:/DEV/OpenJDK_7u40/hotspo >> t/make/windows/makefiles) by the current working directory >> (/cygdrive/z/DEV/OpenJDK_7u40/hotspot/)... >> I guess that's because Z:/... is a relative path on Unix (as opposed >> to Windows). >> >> Is there a way to avoid this prefix so that the commad: cd >> Z:/DEV/OpenJDK_7u40/hotspot/make/windows/makefiles just prepend by the >> cygdrive prefix? > Use a proper cygwin path, e.g. > > /cygdrive/z/DEV/OpenJDK_7u40/hotspot/make/windows/makefiles > > I typically do it like this: only use Unix style paths in scripts. If > I invoke a Windows command I convert necessary paths with "cygpath -a > {path}". I even have a script somewhere which looks at command line > arguments and converts them on the fly if it thinks it's a path (the > heuristic I use is that I test the path for existence and if that > fails I use dirname of the path and test it for existing directory). > > Kind regards > > robert > > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |