Linux Shell Scripting Tutorial (LSST) v1.05r3
| || |
Chapter 1: Introduction : Linux Shell basics
What is a Shell Script or shell scripting?
Normally shells are interactive. It means the shell will accept command from you (via keyboard) and execute them. However, if you store a sequence of commands to a text file and tell the shell to execute the text file instead of entering the commands, that is known as a shell program or shell script.
Shell script defined as
"Shell script is a series of command(s) stored in a plain text file. A shell script is similar to a batch file in MS-DOS, but is much more powerfull."
Each shell script consists of
- Shell commands such as if..else, do..while
- Linux text processing utilities such as grep, awk, cut
- Linux binary commands such as w, who, free etc
Did you know?
- It is the shell that lets you run different commands without having to type the full pathname to them even when they do not exist in the current directory
- It is the shell that expands wildcard characters, such as * or ?, thus saving you laborious typing
- It is the shell that gives you the ability to run previously run commands without having to type the full command again by pressing the up arrow, or pulling up a complete list with the history command
- It is the shell that does input, output and error redirection