-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packaged echo.exe removing braces from cmdline arguments #561
Comments
It's not because of space but because of quotes:
Not reproducible in Git Bash:
|
I agree with @Radrik5 that you need to quote arguments you do not want to be interpolated in any way. |
I assure you this is not a situation where interpolation should be happening. But first let me convince you of it: First, expected behaviour from ubuntu:
Using cmd.exe's builtin:
Avoiding the shell with python subprocess:
EDIT: and some other executable:
|
I know that But since you do not want the argument to be interpolated, you should quote it. And since that works around the curly braces problem, I cannot afford to spend time fixing this issue ("wontfix"). Of course you should feel more than welcome to give it a shot yourself. The first thing to do, if you choose to accept this task, is to run the command through |
If the goal is to provide a conforming implementation of echo (which I believe it is), this is actually a bug. I can't just go quoting strings, this'll lead to another class of bugs with over-quoting (I'm not even using a shell in the first place!):
That said, looking at the strace output: http://paste.pound-python.org/show/Kv30PQaptsi0IFEstkfS/ it seems the problem is here (you can see it receives the correct arguments, then munges them):
|
Is it possible that there is actually a file |
Never mind, I just verified that such a file does not need to exist for that behavior. |
Try > set MSYS=noglob
> "\Program Files\git\usr\bin\echo.exe" hi{1}
hi{1} |
@dscho Is that thing ( Also, where exactly is git-for-windows getting its coreutils from? |
I can't find any reference to 'noglob' in that repo. |
There's a
The intent seems to be to have bourne-shell-like glob behavior when not using the bourne shell. |
Correct. Since MSys2 is a (friendly) fork of Cygwin, the environment variable has been renamed (to avoid interfering with Cygwin when trying to mix and match MSys2 with Cygwin).
Indeed. Unix users seem to expect globs to work when running from |
I think it shouldn't expand braces without comma: |
The fact that it expands '"{1}"' to {1}" is entirely wrong, as well. On Tue, Dec 8, 2015 at 12:38 PM Dmitry Oksenchuk notifications@github.com
|
Hey, feel free to fix this and contribute the fix to the Cygwin project. |
Version info:
Expected:
Interestingly enough, this works:
The text was updated successfully, but these errors were encountered: