This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.7.25: problem with the cd command in ksh
- From: Robert Klemme <shortcutter at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 6 Oct 2013 13:06:52 +0200
- Subject: Re: 1.7.25: problem with the cd command in ksh
- Authentication-results: sourceware.org; auth=none
- References: <524FB2BB dot 40608 at orange dot fr> <CAM9pMnMcQcp4prHqs5Bh1sCt0HGC1zaTcmHEXFPrj_+3ZffjmA at mail dot gmail dot com> <52512348 dot 1050702 at orange dot fr> <5251240C dot 6060805 at easynet dot fr>
On Sun, Oct 6, 2013 at 10:49 AM, Francis ANDRE <francis.andre@easynet.fr> wrote:
> 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?
That question ksh developers or cygwin package maintainers should be
able to answer. They might just use different syscalls which vary in
behavior on Cygwin. You could try to find that out with strace.
Fact remains: using the Windows JDK on Cygwin is always nasty since
it's a Windows program and communication between scripts which use
Unix style paths and programs using Windows style paths soon gets
messy - especially if paths need to go both ways.
For your ksh script the easiest fix would probably be
cd $(cygpath -u "$dir")
If it needs to be cross platform you probably need to spend a bit more
effort e.g. define a shell function dependent on the platform where
the Unix versions just return the argument and the Cygwin version does
the mentioned conversion.
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
--
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