August 1999
Intermediate to advanced
328 pages
8h 58m
English
Creating a shell script is a matter of writing a text file containing valid commands and saving the text file. The script can then be run as an argument to the shell command or as a standalone executable file. Generally, you'll want to make scripts executable on their own.
To create a shell script:
1. | Open a text editor, such as Gnotepad+ (Figure 12.10). |
2. | For the script's first line, type the following:
#! /bin/bash |
3. | For the script's next line, on general principles, type a pound sign (indicating a comment line) followed by a description of the script:
# A baby script |
4. | Type the line that does the business of the script (it echoes text to ... |
Read now
Unlock full access