Chapter 9
Shell Scripts
In this chapter, we’ll build on the foundation laid in Section 1.4 and write three shell scripts of increasing sophistication. Although web development is the most common application of Ruby programming nowadays, shell scripting is Ruby’s native habitat, so it’s a task at which Ruby understandably excels. Indeed, readers who have studied the analogous material in the context of JavaScript may be impressed at how much more elegant and polished the Ruby versions are.
In the first two programs ( Section 9.1 and Section 9.2), we’ll take the Ruby gem developed in Chapter 8 and put it to work detecting palindromes drawn from two different sources: a file, and the Web. In the process, we’ll learn how to read and write from files ...
Get Learn Enough Ruby to Be Dangerous: Write Programs, Publish Gems, and Develop Sinatra Web Apps 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.