October 2001
Intermediate to advanced
1040 pages
22h 50m
English
Writing shell scripts requires a few steps, as outlined in the following section.
A shell script is normally written in an editor and consists of commands interspersed with comments. Comments are preceded by a pound sign.
The First Line. At the top-left corner, to indicate the program that will be executing the lines in the script, #!/bin/ksh is commonly used. The #! is called a magic number and is used by the kernel to identify the program that should be interpreting the lines in the script. This line must be the top line of your script. The Korn shell also provides a number of invocation options that control how the shell behaves. These options are listed at ...