Summary

In this chapter, you learned about the concept of input and output and examined the echo and printf commands that are used to produce messages from within shell scripts. You also learned about output redirection, and covered the methods of redirecting and appending the output of a command to a file. You also learned about the concept of a file descriptor and saw several aspects of its use, including opening files for reading and writing, closing files, and redirecting the output of two file descriptors to one source.

In subsequent chapters, you will expand on the material covered here, and you will see many more applications of both input and output redirection along with the use of file descriptors.

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition 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.