Scripting languages are similar to batch files in DOS environment.
A shell script is a sequence of UNIX commands in a text (ASCII) file.
The following sequence of commands creates a script file named first with one UNIX command:
cd /cs241/lab2
vi first
man -k shell sort -u more
(save and exit the file by pressing ESC :wq)
To execute it in bourne shell use:
sh first
For shell, first is not an executable program yet. To become one, the command
chmod a+x first
must be executed. Now,
./first
executes the shell script as desired.
More complicated shell programs are discussed in lab3.