The Shellwords module in Ruby manipulates strings according to the parsing rules of the UNIX Bourne shell. It includes methods to split strings into arrays of words, escape strings for use in shell commands, and join arrays of words into strings. The module conforms to POSIX standards for shell word parsing and provides aliases for common shell utilities like split, escape, and join. Strings and arrays can use shorthand methods like shellsplit, shellescape, and shelljoin to interact with the module.
2. WHAT IS IT?
“This module manipulates strings according to the word
parsing rules of the UNIX Bourne shell.”
(http://www.ruby-doc.org/ruby-1.9/classes/Shellwords.html)
Conforms to POSIX / SUSv3 (IEEE Std 1003.1-2001)
Built on String#scan
require ‘shellwords’