module Shellwords

Public Instance Methods

escape(cmdline) click to toggle source

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

# File lib/more/facets/shellwords.rb, line 10
def escape(cmdline)
  cmdline.gsub(%r([\\\t\| &`<>)('"])/) { |s| '\' << s }
end