Shell Script Basics

A UNIX script is a sequence of UNIX commands—either in a file or typed at the command line—that performs multiple operations. Such files also are known as “batch files” in some systems. Another term for a script that might be familiar to you is “macro.” Usually, a script or macro refers to a simple command sequence, but a shell program identifies a file containing a more complicated arrangement of commands. Shell programs use the shell’s control and conditional commands, called built-ins, which are discussed later in this chapter.

To run a file as a script, you must set the file’s execution bit, as discussed in Chapter 16, “System Security.” In the following example, you can see that the execution bit has been set for ...

Get Inside Solaris™ 9 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.