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

Unable to pass a literal asterisk to a sh* call #1

Closed
chr15m opened this issue Nov 28, 2019 · 2 comments
Closed

Unable to pass a literal asterisk to a sh* call #1

chr15m opened this issue Nov 28, 2019 · 2 comments
Labels
bug Something isn't working has-pr This issue has a candidate PR.

Comments

@chr15m
Copy link
Owner

chr15m commented Nov 28, 2019

Given a file called core-fns.txt containing strings like this:

 [hello]=hello
 [something]=something

The following invocation fails to capture the [hello]:

(sh* "grep -oE '.*\]' core-fns.txt")

Internally the asterisk is escaped into __STAR__ and passed through to bash. The following behaves in an identical way:

(sh* "grep -oE '.__STAR__\]' core-fns.txt")

@kanaka I know it's been a long time since you looked at this but if you have any hints off the top if your head how a user can get around this to pass an asterisk do let me know.

@chr15m chr15m added bug Something isn't working help wanted Extra attention is needed labels Nov 28, 2019
@chr15m chr15m removed the help wanted Extra attention is needed label Nov 30, 2019
@chr15m
Copy link
Owner Author

chr15m commented Nov 30, 2019

Fixed in kanaka/mal#470

chr15m added a commit to chr15m/mal that referenced this issue Dec 2, 2019
This supercedes kanaka#470 and includes kanaka#471.
This fixes some edge cases when passing an asterisk to an sh* interop call.
Before this fix mal would the string with any wildcard character converted to __STAR__ when passing to the subcommand.
See the tests for examples of where this would fail to do what the user expects.
See also: chr15m/flk#1
chr15m added a commit to chr15m/mal that referenced this issue Dec 2, 2019
This supercedes kanaka#470 and includes kanaka#471.
This fixes some edge cases when passing an asterisk to an sh* interop call.
Before this fix mal would pass the string with any wildcard character converted to __STAR__ when passing to the subcommand.
For example `(sh* "ls *")` would become `ls __STAR__` when executed.
See the tests for examples of where this would fail to do what the user expects.
See also: chr15m/flk#1
@chr15m chr15m added the has-pr This issue has a candidate PR. label Dec 2, 2019
@chr15m
Copy link
Owner Author

chr15m commented Dec 2, 2019

Upstream patch has been merged. 🎉

@chr15m chr15m closed this as completed Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-pr This issue has a candidate PR.
Projects
None yet
Development

No branches or pull requests

1 participant