Aftershock
Aftershock

Reputation: 5351

cannot pass dos path and to preserve it in cygwin command line

I have problems passign windows path to an non-Cygwin application in Cygwin

app 'd:\path\file'

That application gives an error of /d:/path/file does not exist.

How stop Cygwin with modifying the input argument in this case?

It prepends / to the path.

It does not prepend, it just looks so by the misleading error message.

Upvotes: 0

Views: 337

Answers (2)

Miserable Variable
Miserable Variable

Reputation: 28752

Which version are you using? I don't see that with my cygwin. You may have better luck with

app "$(cygpath -ma <cygwin-path<)"

My environment:

$ cygcheck -c bash cygwin
Cygwin Package Information
Package              Version        Status
bash                 4.1.10-4       OK
cygwin               1.7.9-1        OK
$ cat check.bat
@echo %1%
$ ./check.bat 'c:\cygwin\tmp\t'
c:\cygwin\tmp\t

Upvotes: 0

Attila
Attila

Reputation: 28762

You can protect the path by enclosing in quotes e.g. notepad "c:\a.txt". You also might need to protect the backslash (\) characters in the path by doubling them (notepad "c:\\a.txt").

Upvotes: 1

Related Questions