O'Reilly logo

Practical Ruby for System Administration by André Ben Hamou

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

One-liners

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

In the previous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required