method

shelljoin

v1_8_7_72 - Show latest stable - Class: Shellwords
shelljoin(array)
public

Builds a command line string from an argument list array joining all elements escaped for Bourne shell and separated by a space.

  open('|' + Shellwords.join(['grep', pattern, *files])) { |pipe|
    # ...
  }

+Array#shelljoin+ is a shorthand for this function.

  open('|' + ['grep', pattern, *files].shelljoin) { |pipe|
    # ...
  }