This is the mail archive of the
mailing list for the Cygwin project.
Re: CygWin backslash variable - stores dos based filename with path
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 06 Aug 2009 00:26:19 +0100
- Subject: Re: CygWin backslash variable - stores dos based filename with path
- References: <email@example.com>
Rajesh George CetusTech wrote:
> I am very new to CygWin, but having experience in Solaris, RedHat linux,
> Oracle linux and Microsoft Windows.
> My issue: Am running one batch job from Windows, which needs to execute one
> .sh file using CygWin and the batch file passes the filename with path
> (windows/DOS style) to the .sh shell.
> Shell of cygwin removing all the '\' s and made the file path as a different
> For example, "e:\test\testcomn\util\jre\1.1.8\bin\jre.exe" become
> "e:testtestcomnutiljre1.1.8binjre.exe" and I got "command not found" error.
> In this case, am not allowed to edit the any bat/sh files. But I can modify
> the CygWin settings.
> Please advice, How to make CygWin to convert automatically file path from
> "e:\test\testcomn\util\jre\1.1.8\bin\jre.exe" to
Cygwin doesn't have any built-in feature such as you wish, because it tries to
impersonate Linux and Linux doesn't do that.
Cygwin is like linux: backslash is an escape character in the shell, not a
path separator. What you want to do wouldn't work on Linux, and the whole point
of Cygwin is to imitate Linux on Windows.
So, why are you using Cygwin at all if you just want to run Windows programs
and that's difficult under Cygwin because of the differences in file path
syntax? If you really aren't allowed to change anything at all, then obviously
nothing will happen differently. Or can you just use forward slashes, which
will work on both Windows and Cygwin? There is also the cygpath command, which
converts between Cygwin POSIX and Windows DOS-style paths, and you might be able
to use that, but you'd have to be allowed to change either the .bat file or the
.sh script. Explain your situation in a bit more detail and we might be able to
figure a workaround for you.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple