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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.