123456789_123456789_123456789_123456789_123456789_

Ruby Command-Line Options

About the Examples

Some examples here use command-line option -e, which passes the Ruby code to be executed on the command line itself:

$ ruby -e 'puts "Hello, World."'

Some examples here assume that file desiderata.txt exists:

$ cat desiderata.txt
Go placidly amid the noise and the haste,
and remember what peace there may be in silence.
As far as possible, without surrender,
be on good terms with all persons.

Options

-0: Set $/ (Input Record Separator)

Option -0 defines the input record separator $/ for the invoked Ruby program.

The optional argument to the option must be octal digits, each in the range 0..7; these digits are prefixed with digit 0 to form an octal value.

If no argument is given, the input record separator is 0x00.

If an argument is given, it must immediately follow the option (no intervening whitespace or equal-sign character '='); argument values: