📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 01:48:58
📂
/ (Root)
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Shellwords
📍 /opt/alt/ruby27/share/ri/system/Shellwords
🔄 Refresh
✏️
Editing: cdesc-Shellwords.ri
Read Only
U:RDoc::NormalModule[iI"Shellwords:ET@0o:RDoc::Markup::Document:@parts[o;;['S:RDoc::Markup::Heading: leveli: textI"3Manipulates strings like the UNIX Bourne shell;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph;[I"IThis module manipulates strings according to the word parsing rules ;TI"of the UNIX Bourne shell.;T@o; ;[I"GThe shellwords() function was originally a port of shellwords.pl, ;TI"Ibut modified to conform to the Shell & Utilities volume of the IEEE ;TI"'Std 1003.1-2008, 2016 Edition [1].;T@S; ; i;I" Usage;T@o; ;[I"QYou can use Shellwords to parse a string into a Bourne shell friendly Array.;T@o:RDoc::Markup::Verbatim;[ I"require 'shellwords' ;TI" ;TI"3argv = Shellwords.split('three blind "mice"') ;TI")argv #=> ["three", "blind", "mice"] ;T:@format0o; ;[I"COnce you've required Shellwords, you can use the #split alias ;TI"String#shellsplit.;T@o;;[I"*argv = "see how they run".shellsplit ;TI",argv #=> ["see", "how", "they", "run"] ;T;0o; ;[I"2Be careful you don't leave a quote unmatched.;T@o;;[I">argv = "they all ran after the farmer's wife".shellsplit ;TI"9 #=> ArgumentError: Unmatched double quote: ... ;T;0o; ;[I"IIn this case, you might want to use Shellwords.escape, or its alias ;TI"String#shellescape.;T@o; ;[I"RThis method will escape the String for you to safely use with a Bourne shell.;T@o;;[I"/argv = Shellwords.escape("special's.txt") ;TI" argv #=> "special\\'s.txt" ;TI"system("cat " + argv) ;T;0o; ;[I"LShellwords also comes with a core extension for Array, Array#shelljoin.;T@o;;[I"argv = %w{ls -lta lib} ;TI"system(argv.shelljoin) ;T;0o; ;[I"SYou can use this method to create an escaped string out of an array of tokens ;TI"Lseparated by a space. In this example we used the literal shortcut for ;TI"Array.new.;T@S; ; i;I"Authors;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"Wakou Aoyama;To;;0;[o; ;[I"%Akinori MUSHA <knu@iDaemons.org>;T@S; ; i;I"Contact;To;;;;[o;;0;[o; ;[I":Akinori MUSHA <knu@iDaemons.org> (current maintainer);T@S; ; i;I"Resources;T@o; ;[I"�1: {IEEE Std 1003.1-2008, 2016 Edition, the Shell & Utilities volume}[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html];T: @fileI"lib/shellwords.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [ [[I" class;T[[:public[ [:protected[ [:private[[I"escape;TI"lib/shellwords.rb;T[I" join;T@v[I"shellescape;T@v[I"shelljoin;T@v[I"shellsplit;T@v[I"shellwords;T@v[I" split;T@v[I" instance;T[[;[ [;[ [;[ [@z@v[@|@v[@~@v[@{@v[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"lib/shellwords.rb;T@fcRDoc::TopLevel
💾 Save Changes
❌ Cancel