March 2002
Beginner
504 pages
10h 47m
English
As you saw in previous chapters, the general format for the invocation of programs in UNIX is
cmd opts files
Here cmd is the command name, opts is any option that you need to specify, and files is an optional list of files on which the command should operate. Consider the following example:
$ ls -l *.doc
Here ls is the command, -l is the only option, and *.doc is the list of files for ls to operate on.
Because most UNIX users are familiar with this interface, it is best to use this format in shell scripts. This means that scripts that can have options must be able to read and interpret them correctly.
This chapter examines the following topics related to the handling of options passed to a shell script:
Read now
Unlock full access