Chapter 3Shell One-Liners

We’ve looked at processing text in Ruby scripts, but there exists a stage of text processing in which writing full-blown scripts isn’t the correct approach. It might be because the problem you’re trying to solve is temporary, where you don’t want the solution hanging around. It might be that the problem is particularly lightweight or simple, unworthy of being committed to a file. Or it might be that you’re in the early stages of formulating a solution and are just trying to explore things for now.

In such cases, it would be advantageous to be able to process text from the command line, without having to go to the trouble of committing your thoughts to a file. This would allow you to quickly throw together text processing ...

Get Text Processing with Ruby now with O’Reilly online learning.

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