Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit 018c8f0

Browse files
formatting changes, improved fixed string matching section
1 parent 0adb0ad commit 018c8f0

File tree

1 file changed

+68
-78
lines changed

1 file changed

+68
-78
lines changed

‎ruby_one_liners.md

Lines changed: 68 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ DESCRIPTION
8484
**Prerequisites and notes**
8585

8686
* familiarity with programming concepts like variables, printing, control structures, arrays, etc
87-
* familiarity with regular expression
87+
* familiarity with regular expressions
8888
* this tutorial is primarily focussed on short programs that are easily usable from command line, similar to using `grep`, `sed`, `awk`, `perl` etc
8989
* unless otherwise specified, consider input as ASCII encoded text only
9090
* this is an attempt to translate [Perl chapter](./perl_the_swiss_knife.md) to `ruby`, I don't have prior experience of using `ruby`
@@ -197,8 +197,8 @@ I bought two bananas and three mangoes
197197

198198
**Further Reading**
199199

200-
* [ruby-doc Pre-defined variables](https://ruby-doc.org/core-2.5.0/doc/globals_rdoc.html#label-Pre-defined+variables) for explanation on `$_` and other such special variables
201-
* [ruby-doc gsub](https://ruby-doc.org/core-2.5.0/String.html#method-i-gsub) for `gsub` syntax details
200+
* [ruby-doc: Pre-defined variables](https://ruby-doc.org/core-2.5.0/doc/globals_rdoc.html#label-Pre-defined+variables) for explanation on `$_` and other such special variables
201+
* [ruby-doc: gsub](https://ruby-doc.org/core-2.5.0/String.html#method-i-gsub) for `gsub` syntax details
202202

203203
<br>
204204

@@ -209,9 +209,9 @@ I bought two bananas and three mangoes
209209
#### <a name="regular-expressions-based-filtering"></a>Regular expressions based filtering
210210

211211
* one way is to use `variable =~ /REGEXP/FLAGS` to check for a match
212-
* `variable !~ /REGEXP/FLAGS` for negated match
212+
* use `variable !~ /REGEXP/FLAGS` for negated match
213213
* by default acts on `$_` if variable is not specified
214-
* see [ruby-doc Regexp](https://ruby-doc.org/core-2.5.0/Regexp.html) for regular expression details
214+
* see [ruby-doc: Regexp](https://ruby-doc.org/core-2.5.0/Regexp.html) for regular expression details
215215
* as we need to print only selective lines, use `-n` option
216216
* by default, contents of `$_` will be printed if no argument is passed to `print`
217217

@@ -244,7 +244,7 @@ Violets are blue,
244244
```
245245

246246
* using different delimiter
247-
* quoting from [ruby-doc Percent Strings](https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Percent+Strings)
247+
* quoting from [ruby-doc: Percent Strings](https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Percent+Strings)
248248

249249
> If you are using "(", "[", "{", "<" you must close it with ")", "]", "}", ">" respectively. You may use most other non-alphanumeric characters for percent string delimiters such as "%", "|", "^", etc.
250250
@@ -272,73 +272,62 @@ $ ruby -ne 'print if !%r#/foo/a/#' paths.txt
272272

273273
#### <a name="fixed-string-matching"></a>Fixed string matching
274274

275-
* To match strings literally, use `index`
276-
* See [ruby-doc index](https://ruby-doc.org/core-2.5.0/String.html#method-i-index) for details
275+
* To match strings literally, use `include?` method
277276

278277
```bash
279-
$ # index returns matching position(starts at 0) and nil if not found
280-
$ # same as: perl -ne 'print if index($_, "a[5]") != -1'
281278
$ echo 'int a[5]' | ruby -ne 'print if /a[5]/'
282-
$ echo 'int a[5]' | ruby -ne 'print if $_.index("a[5]")'
279+
$ echo 'int a[5]' | ruby -ne 'print if $_.include?("a[5]")'
283280
int a[5]
284281

285-
$ # however, string within double quotes gets interpolated, for ex
286-
$ ruby -e 'a=5; puts "value of a: #{a}"'
287-
value of a: 5
288-
289-
$ # so, for commandline usage, better to pass string as environment variable
290-
$ # they are accessible via the ENV hash variable
291-
$ # same as: perl -le 'print $ENV{SHELL}'
292-
$ ruby -e 'puts ENV["SHELL"]'
293-
/bin/bash
294-
295-
$ echo 'int #{a}' | ruby -ne 'print if $_.index("#{a}")'
296-
-e:1:in `<main>': undefined local variable or method `a' for main:Object (NameError)
297-
$ echo 'int #{a}' | s='#{a}' ruby -ne 'print if $_.index(ENV["s"])'
282+
$ # however, string within double quotes gets interpolated
283+
$ ruby -e 'a=5; puts "value of a:\t#{a}"'
284+
value of a: 5
285+
$ # use %q (covered later) to specify single quoted string
286+
$ echo 'int #{a}' | ruby -ne 'print if $_.include?(%q/#{a}/)'
287+
int #{a}
288+
$ # or pass the string as environment variable
289+
$ echo 'int #{a}' | s='#{a}' ruby -ne 'print if $_.include?(ENV["s"])'
298290
int #{a}
299291
```
300292

301-
* `index` allows to use regex as well
293+
* restricting match to start/end of line
302294

303295
```bash
304-
$ # passing string
305-
$ ruby -ne 'print if $_.index("a+b")' eqns.txt
296+
$ cat eqns.txt
297+
a=b,a-b=c,c*d
306298
a+b,pi=3.14,5e12
307299
i*(t+9-g)/8,4-a+b
308300

309-
$ # passing regex
310-
$ ruby -ne 'print if $_.index(/a+b/)' eqns.txt
311-
$ ruby -ne 'print if $_.index(/a\+b/)' eqns.txt
301+
$ # start of line
302+
$ s='a+b' ruby -ne 'print if $_.start_with?(ENV["s"])' eqns.txt
312303
a+b,pi=3.14,5e12
304+
305+
$ # end of line
306+
$ # -l option is needed to remove record separator (covered later)
307+
$ s='a+b' ruby -lne 'print if $_.end_with?(ENV["s"])' eqns.txt
313308
i*(t+9-g)/8,4-a+b
314309
```
315310

316-
* return value is useful to match at specific position
317-
* for ex: at start/end of line
311+
* `index` method returns matching position (starts at 0) and nil if not found
312+
* supports both string and regex
313+
* optional 2nd argument allows to specify offset to start searching
314+
* See [ruby-doc: index](https://ruby-doc.org/core-2.5.0/String.html#method-i-index) for details
318315

319316
```bash
320-
$ cat eqns.txt
321-
a=b,a-b=c,c*d
317+
$ # passing string
318+
$ ruby -ne 'print if $_.index("a+b")' eqns.txt
322319
a+b,pi=3.14,5e12
323320
i*(t+9-g)/8,4-a+b
324-
325-
$ # start of line
326-
$ # same as: s='a+b' perl -ne 'print if index($_, $ENV{s})==0' eqns.txt
327-
$ s='a+b' ruby -ne 'print if $_.index(ENV["s"])==0' eqns.txt
321+
$ ruby -ne 'print if $_.index("a+b")==0' eqns.txt
328322
a+b,pi=3.14,5e12
329323

330-
$ # optional 2nd argument allows to specify offset to start searching
331-
$ # similar to: s='a+b' perl -ne 'print if index($_, $ENV{s})>0' eqns.txt
332-
$ s='a+b' ruby -ne 'print if $_.index(ENV["s"], 1)' eqns.txt
324+
$ # passing regex
325+
$ ruby -ne 'print if $_.index(/[+*]/)<5' eqns.txt
326+
a+b,pi=3.14,5e12
333327
i*(t+9-g)/8,4-a+b
334328

335-
$ # end of line
336-
$ # same as: s='a+b' perl -ne '$pos = length() - length($ENV{s}) - 1;
337-
$ # print if index($_, $ENV{s}) == $pos' eqns.txt
338-
$ s='a+b' ruby -ne 'pos = $_.length - ENV["s"].length - 1;
339-
print if $_.index(ENV["s"]) == pos' eqns.txt
329+
$ s='a+b' ruby -ne 'print if $_.index(ENV["s"], 1)' eqns.txt
340330
i*(t+9-g)/8,4-a+b
341-
$ # .size can also be used instead of .length
342331
```
343332

344333
<br>
@@ -347,7 +336,7 @@ $ # .size can also be used instead of .length
347336

348337
* special variable `$.` contains total records read so far, similar to `NR` in `awk`
349338
* as far as I've checked the docs, there's no equivalent of awk's `FNR`
350-
* See also [ruby-doc eof](https://ruby-doc.org/core-2.5.0/IO.html#method-i-eof)
339+
* See also [ruby-doc: eof](https://ruby-doc.org/core-2.5.0/IO.html#method-i-eof)
351340

352341
```bash
353342
$ # print 2nd line
@@ -370,7 +359,7 @@ And so are you.
370359
```
371360

372361
* for large input, use `exit` to avoid unnecessary record processing
373-
* See [ruby-doc Control Expressions](https://ruby-doc.org/core-2.5.0/doc/syntax/control_expressions_rdoc.html) for syntax details
362+
* See [ruby-doc: Control Expressions](https://ruby-doc.org/core-2.5.0/doc/syntax/control_expressions_rdoc.html) for syntax details
374363

375364
```bash
376365
$ # same as: perl -ne 'if($.==234){print; exit}'
@@ -394,7 +383,7 @@ $ seq 14 25 | ruby -pe 'exit if $.==3'
394383
```
395384

396385
* selecting range of lines
397-
* See [ruby-doc Range](https://ruby-doc.org/core-2.5.0/Range.html) for syntax details
386+
* See [ruby-doc: Range](https://ruby-doc.org/core-2.5.0/Range.html) for syntax details
398387

399388
```bash
400389
$ # in this context, the range is compared against $.
@@ -472,7 +461,7 @@ $ printf ' a ate b\tc \n' | ruby -ane 'puts $F.length'
472461

473462
* operators `=`, `!=`, `<`, etc will work for both string/numeric comparison
474463
* unlike `perl`, numeric comparison for text requires converting to appropriate numeric format
475-
* See [ruby-doc string methods](https://ruby-doc.org/core-2.5.0/String.html#method-i-to_c) for details
464+
* See [ruby-doc: string methods](https://ruby-doc.org/core-2.5.0/String.html#method-i-to_c) for details
476465

477466
```bash
478467
$ # if first field exactly matches the string 'apple'
@@ -563,7 +552,7 @@ baz
563552
```
564553

565554
* to process individual characters, simply use indexing on input string
566-
* See [ruby-doc Encoding](https://ruby-doc.org/core-2.5.0/Encoding.html) for details on handling different string encodings
555+
* See [ruby-doc: Encoding](https://ruby-doc.org/core-2.5.0/Encoding.html) for details on handling different string encodings
567556

568557
```bash
569558
$ # same as: perl -F -lane 'print $F[0]'
@@ -850,7 +839,7 @@ $ seq 6 | ruby -lpe '$\ = $.%3!=0 ? "-" : "\n"'
850839

851840
* Processing consecutive lines
852841
* to keep the one-liner short, global variables(`$` prefix) are used here
853-
* See [ruby-doc Global variables](https://ruby-doc.org/core-2.5.0/doc/syntax/assignment_rdoc.html#label-Global+Variables) for syntax details
842+
* See [ruby-doc: Global variables](https://ruby-doc.org/core-2.5.0/doc/syntax/assignment_rdoc.html#label-Global+Variables) for syntax details
854843

855844
```bash
856845
$ cat poem.txt
@@ -934,9 +923,10 @@ a
934923

935924
## <a name="ruby-regular-expressions"></a>Ruby regular expressions
936925

937-
* assuming that you are already familiar with basic [ERE features](./gnu_sed.md#regular-expressions)
926+
* assuming that you are already familiar with basics of regular expressions
927+
* if not, see [Ruby Regular Expressions tutorial](https://github.com/learnbyexample/Ruby_Scripting/blob/master/chapters/Regular_expressions.md)
938928
* examples/descriptions based only on ASCII encoding
939-
* See [ruby-doc Regexp](https://ruby-doc.org/core-2.5.0/Regexp.html) for syntax and feature details
929+
* See [ruby-doc: Regexp](https://ruby-doc.org/core-2.5.0/Regexp.html) for syntax and feature details
940930
* See [rexegg ruby](https://www.rexegg.com/regex-ruby.html) for a bit of ruby regex history and differences with other regex engines
941931

942932
<br>
@@ -1021,7 +1011,7 @@ $ # without newline at end of line, both \z and \Z will give same result
10211011
```
10221012

10231013
* delimiters and quoting
1024-
* from [ruby-doc Percent Strings](https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Percent+Strings)
1014+
* from [ruby-doc: Percent Strings](https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Percent+Strings)
10251015

10261016
> If you are using "(", "[", "{", "<" you must close it with ")", "]", "}", ">" respectively. You may use most other non-alphanumeric characters for percent string delimiters such as "%", "|", "^", etc.
10271017
@@ -1126,7 +1116,7 @@ $ echo '123:42:789:good:5:bad' | ruby -pe 'sub(/:.*:[a-z]/, ":")'
11261116
The string matched by lookarounds are like word boundaries and anchors, do not constitute as part of matched string. They are termed as **zero-width patterns**
11271117

11281118
* positive lookbehind `(?<=`
1129-
* See also [ruby-doc scan](https://ruby-doc.org/core-2.5.0/String.html#method-i-scan)
1119+
* See also [ruby-doc: scan](https://ruby-doc.org/core-2.5.0/String.html#method-i-scan)
11301120

11311121
```bash
11321122
$ s='foo=5, bar=3; x=83, y=120'
@@ -1330,7 +1320,7 @@ He he he
13301320
13311321
* block form allows to use `ruby` code for replacement section
13321322
1333-
quoting from [ruby-doc gsub](https://ruby-doc.org/core-2.5.0/String.html#method-i-gsub)
1323+
quoting from [ruby-doc: gsub](https://ruby-doc.org/core-2.5.0/String.html#method-i-gsub)
13341324
13351325
>In the block form, the current match string is passed in as a parameter, and variables such as 1ドル, 2ドル, $`, $&, and $' will be set appropriately. The value returned by the block will be substituted for the match on each call.
13361326
@@ -1390,7 +1380,7 @@ x:y:z-a-v-xc-gf
13901380
#### <a name="quoting-metacharacters"></a>Quoting metacharacters
13911381
13921382
* to match contents of string variable exactly, all metacharacters need to be escaped
1393-
* See [ruby-doc Regexp.escape](https://ruby-doc.org/core-2.5.0/Regexp.html#method-c-escape) for syntax details
1383+
* See [ruby-doc: Regexp.escape](https://ruby-doc.org/core-2.5.0/Regexp.html#method-c-escape) for syntax details
13941384
13951385
```bash
13961386
$ cat eqns.txt
@@ -1456,7 +1446,7 @@ White
14561446
14571447
* `-r` command line option allows to specify library required
14581448
* the `include?` method allows to check if `set` already contains the element
1459-
* See [ruby-doc include?(o)](https://ruby-doc.org/stdlib-2.5.0/libdoc/set/rdoc/Set.html#method-i-include-3F) for syntax details
1449+
* See [ruby-doc: include?](https://ruby-doc.org/stdlib-2.5.0/libdoc/set/rdoc/Set.html#method-i-include-3F) for syntax details
14601450
14611451
```bash
14621452
$ # common lines
@@ -1482,10 +1472,10 @@ $ # alternate: ARGV.length==1 ? s.add($_) : s.include?($_) && print
14821472
14831473
alternate solution by using set operations available for arrays
14841474
1485-
* [ruby-doc ARGF](https://ruby-doc.org/core-2.5.0/ARGF.html) filehandle allows to read from filename arguments supplied to script
1475+
* [ruby-doc: ARGF](https://ruby-doc.org/core-2.5.0/ARGF.html) filehandle allows to read from filename arguments supplied to script
14861476
* if filename arguments are not present, it would act upon stdin
14871477
* `STDIN` filehandle allows to read from stdin
1488-
* [ruby-doc readlines](https://ruby-doc.org/core-2.5.0/IO.html#method-c-readlines) method allows to read all the lines as an array
1478+
* [ruby-doc: readlines](https://ruby-doc.org/core-2.5.0/IO.html#method-c-readlines) method allows to read all the lines as an array
14891479
* if filehandle is not specified, default is ARGF
14901480
* some comparison notes
14911481
* both files will get saved as array in memory here, while previous solution would save only first file
@@ -1613,15 +1603,15 @@ $ # ruby -e 'STDIN.readlines.zip(readlines).each {|a| puts a[1] if a[0].to_i>0}'
16131603
16141604
For syntax and implementation details, see
16151605
1616-
* [ruby-doc ARGF](https://ruby-doc.org/core-2.5.0/ARGF.html)
1617-
* [ruby-doc times](https://ruby-doc.org/core-2.5.0/Integer.html#method-i-times)
1618-
* [ruby-doc gets](https://ruby-doc.org/core-2.5.0/IO.html#method-i-gets)
1606+
* [ruby-doc: ARGF](https://ruby-doc.org/core-2.5.0/ARGF.html)
1607+
* [ruby-doc: times](https://ruby-doc.org/core-2.5.0/Integer.html#method-i-times)
1608+
* [ruby-doc: gets](https://ruby-doc.org/core-2.5.0/IO.html#method-i-gets)
16191609
16201610
<br>
16211611
16221612
## <a name="creating-new-fields"></a>Creating new fields
16231613
1624-
* See [ruby-doc slice](https://ruby-doc.org/core-2.5.0/Array.html#method-i-slice) for syntax details
1614+
* See [ruby-doc: slice](https://ruby-doc.org/core-2.5.0/Array.html#method-i-slice) for syntax details
16251615
16261616
```bash
16271617
$ s='foo,bar,123,baz'
@@ -1639,7 +1629,7 @@ foo,bar,123,baz,,,42
16391629
```
16401630
16411631
* adding a field based on existing fields
1642-
* See [ruby-doc Percent Strings](https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Percent+Strings) for details on `%w`
1632+
* See [ruby-doc: Percent Strings](https://ruby-doc.org/core-2.5.0/doc/syntax/literals_rdoc.html#label-Percent+Strings) for details on `%w`
16431633
16441634
```bash
16451635
$ # adding a new 'Grade' field
@@ -1706,7 +1696,7 @@ colors_2.txt
17061696
* `-r` command line option allows to specify library required
17071697
* here, `set` data type is used to keep track of unique values - be it whole line or a particular field
17081698
* the `add?` method will add element to `set` and returns `nil` if element already exists
1709-
* See [ruby-doc add?(o)](https://ruby-doc.org/stdlib-2.5.0/libdoc/set/rdoc/Set.html#method-i-add-3F) for syntax details
1699+
* See [ruby-doc: add?](https://ruby-doc.org/stdlib-2.5.0/libdoc/set/rdoc/Set.html#method-i-add-3F) for syntax details
17101700
17111701
```bash
17121702
$ cat duplicates.txt
@@ -1800,7 +1790,7 @@ test toy 123
18001790
18011791
#### <a name="using-uniq-method"></a>using uniq method
18021792
1803-
* [ruby-doc uniq](https://ruby-doc.org/core-2.5.0/Array.html#method-i-uniq)
1793+
* [ruby-doc: uniq](https://ruby-doc.org/core-2.5.0/Array.html#method-i-uniq)
18041794
* original order is maintained
18051795
18061796
```bash
@@ -2083,7 +2073,7 @@ $ # on matching beginning/end REGEXPs respectively
20832073
20842074
## <a name="array-operations"></a>Array operations
20852075
2086-
See [ruby-doc Array](https://ruby-doc.org/core-2.5.0/Array.html) for various ways to initialize and methods available
2076+
See [ruby-doc: Array](https://ruby-doc.org/core-2.5.0/Array.html) for various ways to initialize and methods available
20872077
20882078
* initialization
20892079
@@ -2112,7 +2102,7 @@ $ ruby -le 's = %w[foo "baz" "a\nb"]; print s[-1]'
21122102
```
21132103
21142104
* array slices
2115-
* See also [ruby-doc Array to Arguments Conversion](https://ruby-doc.org/core-2.5.0/doc/syntax/calling_methods_rdoc.html#label-Array+to+Arguments+Conversion)
2105+
* See also [ruby-doc: Array to Arguments Conversion](https://ruby-doc.org/core-2.5.0/doc/syntax/calling_methods_rdoc.html#label-Array+to+Arguments+Conversion)
21162106
21172107
```bash
21182108
$ # accessing more than one element in random order
@@ -2204,7 +2194,7 @@ $ echo "$s" | ruby -lane 'print $F.sample(2)'
22042194
22052195
#### <a name="sorting"></a>Sorting
22062196
2207-
* [ruby-doc sort](https://ruby-doc.org/core-2.5.0/Array.html#method-i-sort)
2197+
* [ruby-doc: sort](https://ruby-doc.org/core-2.5.0/Array.html#method-i-sort)
22082198
* See also [stackoverflow What does map(&:name) mean in Ruby?](https://stackoverflow.com/questions/1217088/what-does-mapname-mean-in-ruby) for explanation on `&:`
22092199
22102200
```bash
@@ -2298,7 +2288,7 @@ ECE 92 Om
22982288
CSE 67 Amy
22992289
```
23002290
2301-
* [ruby-doc uniq](https://ruby-doc.org/core-2.5.0/Array.html#method-i-uniq)
2291+
* [ruby-doc: uniq](https://ruby-doc.org/core-2.5.0/Array.html#method-i-uniq)
23022292
* order is preserved
23032293
23042294
```bash
@@ -2406,7 +2396,7 @@ $ echo 'foobar' | ruby -lpe '$_.reverse!'
24062396
raboof
24072397
```
24082398
2409-
* See also [ruby-doc Enumerable](https://ruby-doc.org/core-2.5.0/Enumerable.html) for more methods like `inject`
2399+
* See also [ruby-doc: Enumerable](https://ruby-doc.org/core-2.5.0/Enumerable.html) for more methods like `inject`
24102400
24112401
<br>
24122402
@@ -2418,7 +2408,7 @@ raboof
24182408
24192409
* the `-a` command line option uses `split` and automatically saves the results in `$F` array
24202410
* default separator is `\s+` and also strips whitespace from start/end of string
2421-
* See also [ruby-doc - split](https://ruby-doc.org/core-2.5.0/String.html#method-i-split)
2411+
* See also [ruby-doc: split](https://ruby-doc.org/core-2.5.0/String.html#method-i-split)
24222412
24232413
```bash
24242414
$ # specifying maximum number of splits
@@ -2467,7 +2457,7 @@ $ # ruby -F, -ane '$F[1].scan(/[^:]+/) {|x| print [$F[0],x,$F[2]]*","}'
24672457
24682458
#### <a name="fixed-width-processing"></a>Fixed width processing
24692459
2470-
* [ruby-doc unpack](https://ruby-doc.org/core-2.5.0/String.html#method-i-unpack)
2460+
* [ruby-doc: unpack](https://ruby-doc.org/core-2.5.0/String.html#method-i-unpack)
24712461
24722462
```bash
24732463
$ # same as: perl -lne '@x = unpack("a1xa3xa4", $_); print $x[0]'
@@ -2527,7 +2517,7 @@ $ ruby -0777 -ne 'print $_ * 100' poem.txt | wc -c
25272517
25282518
#### <a name="transliteration"></a>transliteration
25292519
2530-
* [ruby-doc tr](https://ruby-doc.org/core-2.5.0/String.html#method-i-tr)
2520+
* [ruby-doc: tr](https://ruby-doc.org/core-2.5.0/String.html#method-i-tr)
25312521
25322522
```bash
25332523
$ echo 'Uryyb Jbeyq' | ruby -pe '$_.tr!("a-zA-Z", "n-za-mN-ZA-M")'
@@ -2580,7 +2570,7 @@ I bought two bananas and three mangoes
25802570
```
25812571
25822572
* return value of `system` or global variable `$?` can be used to act upon exit status of command issued
2583-
* see [ruby-doc system](https://ruby-doc.org/core-2.5.0/Kernel.html#method-i-system) for details
2573+
* see [ruby-doc: system](https://ruby-doc.org/core-2.5.0/Kernel.html#method-i-system) for details
25842574
25852575
```bash
25862576
$ ruby -e 'es=system("ls poem.txt"); puts es'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /