bitrise-io/steps-utils-bash-string-escaper

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

Homepage:

Size: 171

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

steps-utils-bash-string-escaper

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.

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.