Module: Shellwords

Defined in:
lib/more/facets/shellwords.rb

Class Method Summary collapse

Class Method Details

.escape(cmdline) ⇒ Object

Escape special characters used in most unix shells to use it, eg. with system().



39
40
41
# File 'lib/more/facets/shellwords.rb', line 39

def escape(cmdline)
  cmdline.gsub(/([\\\t\| &`<>)('"])/) { |s| '\\' << s }
end