This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inconsistent escaping of bash commands (depends on the first command)


After a good few hours of searching, I've distilled this down as far
as humanly possible. The problem I'm encountering is that if I tell
bash.exe to execute the commands in parameter (using the -c flag),
escaping varies based on what commands I give bash.
A more detailed example:

1 C:\cygwin\bin>bash.exe -x -v -c "C:\\s \\"
2 C:\\s \\
3 + 'C:\s' '\'
4 bash: C:\s: command not found
5 C:\cygwin\bin>bash.exe -x -v -c "C\\s \\"
6 C\s \
7 + Cs
8 bash: line 1: Cs: command not found

Please note that lines 2 and 6 are just bash telling me what command I
gave it. On line 2 you can clearly see how the last argument received
by bash is \\. On line 6 the last argument is a single \. Notice how I
only removed a colon several characters earlier?

With a lot of good will, I can maybe see how this could be useful in
some rare situations. Is this documented behavior? Is there a way to
turn this off? Is the regex /^[a-zA-Z]:/ the only time bash does this?

Thanks
Ives

--
Ives van der Flaas
Wijntuinstraat 10
2330 Merksplas
â 0499/31.54.37
www.GoodSoft.be

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]