O'Reilly logo

Ruby Phrasebook by Jason Clinton

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 8. Ruby One-Liners

You might be asking yourself, “Why one-liners?” To the bearded UNIX guru, it is obvious that each of these examples can be accomplished (and perhaps improved) with simple bash, grep, sed, or awk commands. However, the motivation for this section is twofold: Our readers from the Windows world will find that those programs aren’t available for their platform unless they install something like Cygwin. In addition, most of us mere mortals cannot remember all the semantics for several programming languages 100% of the time. For the programmer and system administrator who swim in Ruby most of the time, it is nice to be able to use knowledge you already have to solve everyday issues. Besides, one-liners are fun!

In Chapter 5 ...

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