Skip to content
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

Unexpected output #56

Open
galamit1 opened this issue Jun 8, 2023 · 1 comment
Open

Unexpected output #56

galamit1 opened this issue Jun 8, 2023 · 1 comment

Comments

@galamit1
Copy link

galamit1 commented Jun 8, 2023

Hello, I'm trying to parse the following command:

command := "RUN /bin/sh -c echo hi --password "pdhjcrkCHJfSchjd3f837"/ # buildkit"
args, err := shellwords.Parse(command)

and I'm getting
"RUN", "/bin/sh", "-c", "echo", "hi", "--password", "pdhjcrkCHJfSchjd3f837/", "#", "buildkit"
so one of the arguments is "pdhjcrkCHJfSchjd3f837/" and it's wrong.

Do you have an idea what can I do in order to avoid it?

Thank you :)

@hifi
Copy link

hifi commented Jul 16, 2023

Just tried this package and noticed this issue, so pardon me just swooping in. I looked at the issues if there was anything recently wrong.

Quotes only group things that may have spaces but don't implicitly add spaces/separation around them to demonstrate I ran this within an actual shell:

$ printf '(%s) (%s) (%s)\n' "foo "/ bar /' baz'
(foo /) (bar) (/ baz)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants