5. And Away We Go
Based on the discussions in Chapter 3, “What Is the Shell?,” you should realize that whenever you type something like
who | wc -l
that you are actually programming in the shell! That’s because the shell is interpreting the command line, recognizing the pipe symbol, connecting the output of the first command to the input of the second, and initiating execution of both commands.
In this chapter, you’ll learn how to write your own commands and how to use shell variables.
Command Files
A shell program can be typed directly at the terminal, as in
$ who | wc -l
or it can be first typed into a file and then the file can be executed by the shell. ...
Get Unix Shell Programming, Third 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.