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
write-out.d: clarify Windows % symbol escaping #10337
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Clarify that in Windows batch files the % must be escaped as %%, and at the command prompt it cannot be escaped which could lead to incorrect expansion. Prior to this change the doc implied % must be escaped as %% in win32 always. --- Examples: If curl --write-out "%{http_code}" is executed in a batch file: {http_code} If curl --write-out "%%{http_code}" is executed in a batch file: %{http_code} If curl --write-out "%{http_code}" is executed from the command prompt: %{http_code} If curl --write-out "%%{http_code}" is executed from the command prompt: %%{http_code} At the command prompt something like "%{speed_download}%{http_code}" would first be parsed by the command interpreter as %{speed_download}% and would be expanded as environment variable {speed_download} if it existed, though that's highly unlikely since Windows environment names don't use braces. --- Reported-by: Muhammad Hussein Ammari Fixes curl#10323 Closes #xxxx
jay
added a commit
to jay/everything-curl
that referenced
this pull request
Jan 23, 2023
- Clarify that in Windows batch files the % must be escaped as %%, and at the command prompt it cannot be escaped which could lead to incorrect expansion. Prior to this change the doc implied % must be escaped as %% in win32 always. --- Examples: If curl --write-out "%{http_code}" is executed in a batch file: {http_code} If curl --write-out "%%{http_code}" is executed in a batch file: %{http_code} If curl --write-out "%{http_code}" is executed from the command prompt: %{http_code} If curl --write-out "%%{http_code}" is executed from the command prompt: %%{http_code} At the command prompt something like "%{speed_download}%{http_code}" would first be parsed by the command interpreter as %{speed_download}% and would be expanded as environment variable {speed_download} if it existed, though that's highly unlikely since Windows environment names don't use braces. --- Reported-by: Muhammad Hussein Ammari Ref: curl/curl#10337 Fixes curl/curl#10323 Closes #xxxx
This was referenced Jan 23, 2023
Closed
jay
added a commit
to curl/everything-curl
that referenced
this pull request
Jan 26, 2023
- Clarify that in Windows batch files the % must be escaped as %%, and at the command prompt it cannot be escaped which could lead to incorrect expansion. Prior to this change the doc implied % must be escaped as %% in win32 always. --- Examples showing how a write-out argument is received by curl: If curl --write-out "%{http_code}" is executed in a batch file: {http_code} If curl --write-out "%%{http_code}" is executed in a batch file: %{http_code} If curl --write-out "%{http_code}" is executed from the command prompt: %{http_code} If curl --write-out "%%{http_code}" is executed from the command prompt: %%{http_code} At the command prompt something like "%{speed_download}%{http_code}" would first be parsed by the command interpreter as %{speed_download}% and would be expanded as environment variable {speed_download} if it existed, though that's highly unlikely since Windows environment names don't use braces. --- Reported-by: Muhammad Hussein Ammari Ref: curl/curl#10337 Fixes curl/curl#10323 Closes #279
jay
added a commit
that referenced
this pull request
Jan 26, 2023
- Clarify that in Windows batch files the % must be escaped as %%, and at the command prompt it cannot be escaped which could lead to incorrect expansion. Prior to this change the doc implied % must be escaped as %% in win32 always. --- Examples showing how a write-out argument is received by curl: If curl --write-out "%{http_code}" is executed in a batch file: {http_code} If curl --write-out "%%{http_code}" is executed in a batch file: %{http_code} If curl --write-out "%{http_code}" is executed from the command prompt: %{http_code} If curl --write-out "%%{http_code}" is executed from the command prompt: %%{http_code} At the command prompt something like "%{speed_download}%{http_code}" would first be parsed by the command interpreter as %{speed_download}% and would be expanded as environment variable {speed_download} if it existed, though that's highly unlikely since Windows environment names don't use braces. --- Reported-by: Muhammad Hussein Ammari Ref: curl/everything-curl#279 Fixes #10323 Closes #10337
bch
pushed a commit
to bch/curl
that referenced
this pull request
Jul 19, 2023
- Clarify that in Windows batch files the % must be escaped as %%, and at the command prompt it cannot be escaped which could lead to incorrect expansion. Prior to this change the doc implied % must be escaped as %% in win32 always. --- Examples showing how a write-out argument is received by curl: If curl --write-out "%{http_code}" is executed in a batch file: {http_code} If curl --write-out "%%{http_code}" is executed in a batch file: %{http_code} If curl --write-out "%{http_code}" is executed from the command prompt: %{http_code} If curl --write-out "%%{http_code}" is executed from the command prompt: %%{http_code} At the command prompt something like "%{speed_download}%{http_code}" would first be parsed by the command interpreter as %{speed_download}% and would be expanded as environment variable {speed_download} if it existed, though that's highly unlikely since Windows environment names don't use braces. --- Reported-by: Muhammad Hussein Ammari Ref: curl/everything-curl#279 Fixes curl#10323 Closes curl#10337
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this change the doc implied % must be escaped as %% in win32 always.
Examples:
If curl --write-out "%{http_code}" is executed in a batch file: {http_code}
If curl --write-out "%%{http_code}" is executed in a batch file: %{http_code}
If curl --write-out "%{http_code}" is executed from the command prompt: %{http_code}
If curl --write-out "%%{http_code}" is executed from the command prompt: %%{http_code}
At the command prompt something like "%{speed_download}%{http_code}" would first be parsed by the command interpreter as %{speed_download}% and would be expanded as environment variable {speed_download} if it existed, though that's highly unlikely since Windows environment names don't use braces.
Reported-by: Muhammad Hussein Ammari
Fixes #10323
Closes #xxxx