Module | Shellwords |
In: |
lib/mail/core_extensions/shellwords.rb
|
The following is imported from ruby 1.9.2 shellwords.rb
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| # ... }