X-Recipient: archive-cygwin@delorie.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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.andre@easynet.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.andre.kampbell@orange.fr, cygwin@cygwin.com
Subject: Re: 1.7.25: problem with the cd command in ksh
References: <524FB2BB.40608@orange.fr> <CAM9pMnMcQcp4prHqs5Bh1sCt0HGC1zaTcmHEXFPrj_+3ZffjmA@mail.gmail.com> <52512348.1050702@orange.fr>
In-Reply-To: <52512348.1050702@orange.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

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@idefix /cygdrive/c/Cygwin
$ cd Z:/DEV/OpenJDK_7u40/hotspot

moves the cwd without error to
FrancisANDRE@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.andre.kampbell@orange.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

