What is shell
Shell is a program with special features that is an interface between the core program (Kernel) of the user and the UNIX / Linux operating system. Why do we say shell is a system of system core programs and users? Readers who have read the operating system know that the operating system is a managers and distributors of a system resource. When you have a demand, you have to propose to the system; from the perspective of the operating system, it must also prevent the user because What is wrong to cause a system damage? As we all know, the command is commanded under command (COMMAND) or program (Compiler) to convert the program into binary code, but what? In fact, shell is also a program, which is read by the input device, and then converts it to the computer to understand the machine code, and then execute it. Various operating systems have its own shell, with DOS as an example, its shell is a command.com file. Like DOS, there are different command interpretation programs such as NDOS, 4DOS, DRDOS, can replace standard Command.com. Unix has c shell (/ bin / csh), Korn Shell, etc. / BIN / KSH), Bourne Again Shell (/ Bash), Tenex C Shell (TCSH) ... and so on. Unix / Linux will independently, so that it is like a general application that can modify, update the version or add new features without affecting the operating system itself.
$ @ @ 等 特 特 特 meaning
On the actual writing of the shell script, some special variables are useful:
$ # Parameters to the script $ * Displays all the parameters passed to the script with a single string. Unlike the location variable, this option parameter can exceed 9 $$ script running the current process ID number $! The last process of the background runs the process ID number $ @ @ with $ #, but add quotation marks when using, and in quotation marks Returns each parameter $ - Show the current option used by Shell, with the same amount of the set command to show the exit status of the last command. 0 indicates that there is no error, and any other value indicates an error.
How to make the execution result of the program to the screen and files
Program_name | Tee Logfile This program execution is recorded to logfile simultaneously displayed to the standard output (screen).