Wrapping Up
We’ve covered quite a lot in this chapter. We started with a hello world script, the simplest possible use of standard output. Then we looked at standard error, the other output stream, and how we could use it to distinguish between and treat separately two different sorts of output from the same program.
We learned the difference between print and puts, and then looked at a more advanced form of them both: printf, with its flexible and powerful format strings that can be used to format values, convert values from one type to another, and help us generate readable tabular data by aligning our columns for us.
Finally, we explored redirecting standard output from within our script, so that we could use ordinary output methods to write ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access