-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Carriage return \r
being appended to the output
#13573
Comments
hi @zhoxing-ms could you have a look? thanks |
add to S171 |
Hello, just following up on this request, do you have any updates? |
@lchave Hi, this looks like a problem with the incorrect input parameters. Could you please email me the specific parameters of the command and the printed information after adding |
@zhoxing-ms I've sent the requested information please let me know if you need anything else. |
@lchave Hi, through the debug log, I found that this problem was caused by the
May I ask why there is a |
@zhoxing-ms Hi! thanks for the input, we have not added the |
@lchave Could you please describe the environment in detail? By the way, please email me the script you used, thank you~ |
I think I've run into the same issue. I followed the following example: so I had a script like:
what resulted in
|
@arekpalinski May I ask your specific development environment? Is the WSL, Linux, Windows or others? And what is the type of this script? |
Yes, WSL. It's a bash script. |
@arekpalinski Hi, I have reproduced this problem in the WSL environment and identified the root cause: For example:
group_name=$(az group show -n zhoxing-test --query name)
echo $group_name
az group create -l westus --debug -n $group_name
root@DESKTOP-S8GCCTE:/mnt/c/Users/zhoxing.FAREAST/Desktop# file test.sh
test.sh: ASCII text, with CRLF line terminators
root@DESKTOP-S8GCCTE:/mnt/c/Users/zhoxing.FAREAST/Desktop# bash test.sh
"zhoxing-test"
Command arguments: ['group', 'create', '-l', 'westus', '--debug', '-n', '"zhoxing-test"\r\r'] At this point, the value of
root@DESKTOP-S8GCCTE:/mnt/c/Users/zhoxing.FAREAST/Desktop# dos2unix test.sh
dos2unix: converting file test.sh to Unix format...
root@DESKTOP-S8GCCTE:/mnt/c/Users/zhoxing.FAREAST/Desktop# file test.sh
test.sh: ASCII text
root@DESKTOP-S8GCCTE:/mnt/c/Users/zhoxing.FAREAST/Desktop# bash test.sh
"zhoxing-test"
Command arguments: ['group', 'create', '-l', 'westus', '--debug', '-n', '"zhoxing-test"'] Problem solving after the file format becomes For more information, please refer to: click |
Because there is no reply to this question for a long time, I will close it temporarily. If you have any questions, please feel free to let us know. |
\r
being appended to the output
There are 2 ways to trigger this issue on WSL. Calling
|
I have created microsoft/WSL#7248 for WSL to improve its behavior. |
I was also having this same issue following the samples on https://docs.microsoft.com/en-us/azure/event-grid/custom-event-to-eventhub#subscribe-to-a-custom-topic. I was able to resolve it by setting the internal field separator on the top of my bash script: |
@treyham91, the
If an argument is quoted, Bash doesn't strip the trailing
I would strongly recommend installing the Ubuntu distribution of Azure CLI in WSL to prevent further frustration. For those who are interested in what |
The Actually, that entry script never worked well even in Git Bash:
Options we have for
|
\r still a problem with Azure CLI v 2.49.0 on WSL Umbuntu installed using which az RESOURCE_GROUP=$(az group list --query "[0].name" -o tsv) |
@gcrockenberg, this is because Bash caches
The result of The solution is to restart your shell. |
This is autogenerated. Please review and update as needed.
Describe the bug
Getting the following error when trying to query the IP address of a NIC for which I had already pulled the ID and sent as a parameter in the show command.
Operation failed with status: 'Bad Request'. Details: 400 Client Error: Bad Request for url: https://management.azure.com/subscriptions/......./resourceGroups/......./providers/Microsoft.Network/networkInterfaces/.........?api-version=2020-04-01
Command Name
az resource show
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az resource show --name {} {} --resource-group {} {} --resource-type {} {} --query {} -o {}
Expected Behavior
Environment Summary
Additional Context
The text was updated successfully, but these errors were encountered: