January 2024
Intermediate to advanced
718 pages
20h 15m
English
Single terms in an expression may be any of the following:
Literal. Ruby literals are boolean, numbers, strings, arrays, hashes, ranges, symbols, and regular expressions. These are described in Ruby Literals.
Shell command. A shell command is a string enclosed in backquotes or in a general delimited string starting with %x. The string is executed using the host operating system’s standard shell, and the resulting standard output stream is returned as the value of the expression. The execution also sets the $? variable with the command’s exit status:
| | filter = "*.c" |
| | files = `ls #{filter}` |
| | files = %x{ls #{filter}} |
Read now
Unlock full access