Created
April 3, 2014 20:03
-
-
Save kjessup/9961791 to your computer and use it in GitHub Desktop.
Returns the string encoded such that it can be given to bash as a literal command line argument. Note that you won't need this for arguments by default if you are using sys_process.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define string->encodeBash() => '"'+regexp('([\\$`"\\\n])', `\\$1`, self)->replaceAll+'"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment