This is the mail archive of the
mailing list for the Cygwin project.
Inconsistent escaping of bash commands (depends on the first command)
- From: Ives van der Flaas <ives dot vdf at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 29 Jul 2010 23:13:57 +0200
- Subject: 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?
Ives van der Flaas
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple