Skip to content

Instantly share code, notes, and snippets.

@kjessup
Created April 3, 2014 20:03
Show Gist options
  • Save kjessup/9961791 to your computer and use it in GitHub Desktop.
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.
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