method
shellescape
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
shellescape(str)
public
Escapes a string so that it can be safely used in a Bourne shell command line.
Note that a resulted string should be used unquoted and is not intended for use in double quotes nor in single quotes.
open("| grep #{Shellwords.escape(pattern)} file") { |pipe| # ... }
+String#shellescape+ is a shorthand for this function.
open("| grep #{pattern.shellescape} file") { |pipe| # ... }