linux shell (a)

Speaking linux shell, in its broadest sense is an application outside the linux kernel, in order to avoid general users operating kernel directly, provided such a "shell", which provides the effect similar to a bridge, a variety of user input variety of commands, such as file management, disk management, and network management commands, and converted to the kernel to be understood that contents of the operation. Narrow sense shell may see it as a programming language is usually divided into two types in terms of programming language is a compiled language class, a class is interpreted language. c, c ++ is a compiled language, while python and shell is interpreted language, also called scripting languages. Perform fast compiled language, but need to execute source code into a binary file, and interpreted language, more flexible, cross-platform can do some good things like gadgets.

It is an inappropriate metaphor, from a certain point of view (of course, can be said to be wrong angle):
Windows DOS ---- ---- BAT
Linux shell ---- ---- shell script

Learning the shell needs to understand some of the history of the development and other linux unix. Freedom Foundation and understand the software development process appears, GNU, GPL, LGPL and so on.
linux is a kernel exactly, is the god linus Finland developed a new kernel based on unix and minix on, but we are talking about linux, more is to combine the linux kernel and GNU some common software linux operating system. GNU software inside these have gcc, bash shell such common software.

unix 3大shell
bourne shell :AT&T
C shell :Berkeley
korn shell:AT&T
linux常用的shell
bourne again shell
TC shell

We can also / etc / shells view supported by the system shell
is often used ubuntu debian-based need to focus on a different kind of friend of bash and dash

dash is streamlined bash, execute faster, but the function will be less, some of the bash will be supported by statements given under dash, such as let i ++, ehco -n 'xxxx ' will not recognize the option n and so on.
If you feel bad to change it links dash / bin / sh enough. Or use bash to execute the script.

process execution shell
(1) reads the input and command line is parsed
(2) assigned to the special characters
(3) establishing the pipe, and redirecting daemon
(4) processing the signal
(5) to establish an executable program

System startup and login shell
/ bin / the Login
/ etc / passwd
related to system calls
fork exec wait exit

perform general classification under category 2 shell case
one is built-in command, will not fork a new process
one is an external command or an executable program, or script, it will fork a new process
affect the current shell built-in commands will be executed ( parent shell) state, and execute external command does not affect the status of the parent of the shell.

Guess you like

Origin blog.51cto.com/12374206/2427867