-
Notifications
You must be signed in to change notification settings - Fork 328
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
shellquote
function for escaping text in custom scripts
#139
Comments
coryb
added a commit
that referenced
this issue
Jan 7, 2018
Okay, just added a toMinJson function to remove the pretty-print, also added shellquote function that takes a string and quotes it. So given this example:
This is the output I get:
|
You sir, are a saint and a scholar. Many thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{{ ... | printf "%q"}}
does not properly quote output for shell, so it's not very useful in thescript:
of custom commands.regReplace
seems to work, but you have to remember to also add extra single quotes yourself else you get strange shell errors.Maybe it's worth exposing a dedicated
shellquote
(or similar) function?Ouput:
It's hard to notice, but the
printf
variant actually only has one item in the list :-)The text was updated successfully, but these errors were encountered: