The basic job of the shell is to execute commands.
The shell executes each command you type.
$CD work;ls-l whizprog.c
First: The format is simple, separating the various components of the command line with a blank Space key or TAB key.
Second, the command name is the first item in the command line. Usually followed by option, any additional parameters (argument) will be placed after the option
Third, the option starts with a dash (or minus sign) followed by a letter. Options are optional and may require parameters. Options that do not require parameters can be merged.
The long option is preceded by a dash or two dashes depending on the program. Two dashes (--) indicate the usage at the end of the option.
$ cd Whizprog-1.1$patch--verbose--backup-p1</tmp/whizprog-1.1-1.2-patch
Finally, a semicolon (;) can be used to split multiple commands in the same line. The shell executes the commands one at a time. If the & symbol is used instead of; the shell executes its previous command in the background, which means that the shell can proceed to the next command without waiting for the command to complete.
The shell recognizes three basic commands:
- Built-in command: By the shell itself is executed by the name of science and technology.
- Shell functions: A well-functioning set of program code, written in the shell language, that can be referenced like a command.
- External command: An external command is a command executed by a copy of the shell (a new process), the basic process is as follows:
- Establish a new process. This process is a replica of the shell.
- In the new process, look for specific commands within the directory listed in the PATH variable.
/bin:/usr/bin:/usr/x11r6/bin/usr/local/bin
is a typical default value for the PATH variable. When the command contains a slash (/) symbol, the path lookup step is skimmed.
- In the new process, replace the executing shell program with the new program found and execute it.
- When the program is complete, the original shell will then read the next command from the terminal, or execute the next command in the script.
Shell Review notes----commands and Parameters