Name: steps-utils-bash-string-escaper
Owner: Bitrise
Description: Escapes a given input string so any "special" character will be escaped with \ (backslash)
Created: 2014-04-30 00:18:35.0
Updated: 2014-12-11 19:57:14.0
Pushed: 2014-12-11 19:55:58.0
Size: 171
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Escapes a given input string so any “special” character will be escaped with \
Useful for escaping another program's input as a string or for saving the input content as a value in an environment profile file like ~/.bash_profile or ~/.bashrc
The escaped result is meant to be used inside quotation marks, the way it's used in the included examples.
The string:
This is a "special" string with 'things' like $this
Will become (with default option):
This\ is\ a\ \"special\"\ string\ with\ \'things\'\ like\ \$this
or with "--no-space"
option:
This is a \"special\" string with \'things\' like \$this
You can find examples of how to use these scripts in the example folder, and the automatic tests in the test folder.