-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Can't search "aws help" output with "grep" due to ^H in the document text #5455
Comments
Hi @atsalolikhin-spokeo, looking into this. |
Hi @atsalolikhin-spokeo, looks like the way the are outputted, emphasized text gets wrapped with |
Thanks @kdaily !
I don't quite understand -- doesn't ^H delete the character? I am not necessarily requesting a change in behavior. :) (If you feel that's appropriate, that's fine -- I see you added the "feature-request" label.) Just curious about it. BTW, awscli is quite impressive, it can do so much! I'm really enjoying learning to use it. |
Good question - I know we use Do you have a use case for the help pages being available as text files, or just curious as to why you couldn't use them this way? If you have a use case, I can leave it as a feature request, or else I can close it as is. Thanks for confirming, and glad you're learning about the capabilities of the AWS CLI. |
Total speculation and out of curiousity, if I look at this output from the
It looks like to get bold, a character is written ( |
Wow, funky! Yeah, "man ping" has it too. I was not aware of that. Nope, I don't have a use case, feel free to close this case -- you folks have enough real work to do. And I agree with your speculation and analysis there. This sounds like printing twice!! If you think ink printing -- printing a character twice would make it darker. How's that for IT archeology? |
Thank you very much! :) |
FWIW, I'd like to see the behavior changed. While not The End of the World (how many bugs truly are?), not being able to grep the output makes the tool feel like it doesn't quite work -- it unnecessarily casts a shade of "Good enough for 1992" on it :-) I stumbled over this "ungrepable help" behavior today, and was going to open a new issue for it but found this one. While writing up issue #5478 I was looking for the
Say what?! I know there's a command line option with 'pag' in it... Looking at the
That "ungrepable help" behavior is surprising. Compare with the
That does not prevent the options from being grepped from either the man page:
...or from the command's
Since others have mentioned
...but I can grep both the
...and the
[0] From the Debian The
[1] From the Debian I would like to see the I'll also note that I think the help content is more important than the formatting of it. In ultimate terms, it would be better to have grepable content without formatting than ungrepable content with formatting. But if the Finally, here we have been talking about grepable help output because that was the use case that lead a couple of us here. But the issue is not specific to |
Hi @salewski, thanks for the thoughtful and detailed response. I'm going to open this as a feature request for more discussion. I do note that we use the |
I'm not certain if this is related, but the aws cli outputs with special characters that make automation/parsing almost impossible. For example, aws sqs create-queue --queue-name queue1 --output text returns the following: ^[[?1h^[=^Mhttp://localhost:4566/000000000000/queue1^[[m^M The same problem happens regardless of output format (text,json,etc) Oooh - this may be a dockerism. The problem is when running the cl from docker like below. docker run --network=host --rm -it -e AWS_DEFAULT_REGION=us-east-1 -e AWS_ACCESS_KEY_ID=not_needed_locally -e AWS_SECRET_ACCESS_KEY=not_needed_locally amazon/aws-cli:2.2.8 --endpoint-url=http://localhost:4566 sqs create-queue --queue-name queue1 --output text I found the "-it" in the docker run caused the conrol character mess, so this is not an issue with awscli, but I'll leave this note in case someone else finds this useful. |
Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
#7041 seems to indirectly solve this by using Before
After
|
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
"aws help" output includes special character ^H which means I can't use grep to search it
SDK version number
aws-cli/1.18.114
Platform/OS/Hardware/Device
macOS Catalina
To Reproduce (observed behavior)
I can't simply grep the output of "aws help". For example:
Yet the text is clearly there:
Then I tried:
Finally I opened /tmp/aws-help.txt in vim:
Why do you have ^H in that line? That's what's breaking my grep. :)
Expected behavior
I was expecting the grep command to return the matching text from the "aws help" output:
Logs/output
N/A (but if you need it, let me know and I can provide it)
Additional context
It's not a show-stopper for me. I know about the AWS CLI User Guide and Command Reference, and about the AWS-Shell project.
The text was updated successfully, but these errors were encountered: