Chapter 2. Common Tasks, Quick Solutions

Much of this book is devoted to writing "proper" code in nice little scripts and demonstrating how much easier Ruby makes this process. Even so, there will always be times when you just want to remove the commas from something or quickly rotate a log. Thus this relatively short chapter sits in deference to the needs of the ten-second script.

The bulk of the chapter uses one-liners to introduce the various command line flags, execution semantics, and variables available in the context of really quick scripting. For a more systematic overview of these entities, refer to the appendix.


Did you hear the one about the priest and the oversized cucumber? No? Consider yourself very lucky.

In the previous ...

Get Practical Ruby for System Administration now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.