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

Properly Escape Arguments to Runner #193

Merged
merged 1 commit into from
Dec 7, 2015
Merged

Conversation

gcymbalski
Copy link
Contributor

Fixes #192

@gcymbalski
Copy link
Contributor Author

This looks to successfully fix the regular expression in question and pass the appropriately-escaped string back out for consumption.

@ooshlablu
Copy link

+1

1 similar comment
@macintux
Copy link
Contributor

macintux commented Dec 4, 2015

👍

gcymbalski added a commit that referenced this pull request Dec 7, 2015
Properly Escape Arguments to Runner
@gcymbalski gcymbalski merged commit c8e4b41 into develop Dec 7, 2015
@gcymbalski gcymbalski deleted the escape-params-better branch December 7, 2015 18:11
# So this regex finds any '"', '{', or '}' and prepends with a '\'
ESCAPED_ARGS=`echo "$@" | sed -e 's/\([{}"]\)/\\\\\1/g'`
# So this regex finds any '(', ')', "'" , '"', '{', or '}' and prepends with a '\'
ESCAPED_ARGS=$(echo "$@" | sed -e "s/\([\\\(\\\){}\"']\)/\\\\\1/g")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESCAPED_ARGS=echo "$@" | sed -e 's/([\(\){}"\x27])/\\\1/g'`` should be equivalent.

The default Solaris shell only supports command substitution with backticks. The single quote character ' can be expressed in sed expressions as \x27.

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

Successfully merging this pull request may close these issues.

4 participants