-
Notifications
You must be signed in to change notification settings - Fork 510
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
Strange quoting behavior when using cmd.exe #743
Comments
I have a feeling that this might be an inherent limitation of cmd.exe. Let's use this Justfile as an example: foo:
echo "bar" When
However, when
Which translates into So I'm not sure how to make this work. I tried different combinations of quotes, spaces, carets (which is an escape character in Is using PowerShell an option for you? I think it has much saner quoting behavior than Also, if someone knows how to get this to work, definitely chime in. I'm thinking that I should perhaps put the powershell instructions first in the readme, so that people are more likely to try it than |
from
I couldn't get it working with |
Same, I tried with and without |
I ran some more research, and this is really strange.
and
and
So here the quotes behave like in But these two invocations are different:
and
This is really strange to me. Is it special-casing Also, following the answer here, this works as
To figure out what's happening, I ran
and got
I'm completely lost. |
I have a suspicion that the behavior when you type a command into the So when you do, in the terminal:
There is a different quoting behavior as if you do:
This is the only thing I can think of that might explain the inconsistency. |
I think that this is an inherent limitation of windows, and can't be addressed by making a change to Just, so I'm going to close this. Please feel free to re-open or comment if that's not the case! |
@casey Yeah, Windows command line (any invocation) is crazy. See http://www.windowsinspired.com/summary-of-important-concepts-for-quoting-and-escaping-command-line-arguments/ |
Wow, thanks for this. My mind is blown, it's even nuttier than I thought. |
Windows strikes again... |
This was noticed by @SuperCuber in #741.
Quoting commands, which works when using
cmd.exe
interactively, doesn't work in a Justfile.This works:
But this doesn't:
The
"
s are passed tocmd.exe
, and interpreted as part of the command name. Aside from just being weird, this makes it impossible to run commands with spaces.The text was updated successfully, but these errors were encountered: