The Shell's English interpretation is the shell, echoing with the kernel kernel noun, one outside, one shell and one core. The kernel is like the Bank of Switzerland's treasury, storing the customer's gold and many other (hardware) assets, unauthorized people (including customers) are strictly prohibited, and as a customer to access the assets in the Treasury will need to be done by a specific management personnel on behalf of the operation, and the access (operation) results presented to the customer. In the Linux operating system, the shell functions like a vault operator, the customer is the computer user, the user only need to tell the shell corresponding operational requirements, the shell will be the operational requirements to the kernel, and return the results to the operator, as to how the process is implemented, There is no need to be visible to the author.
Of course, have been to the bank know, do everything have to fill in the form, the table is equivalent to a specification, operator and Shell Communication also need to follow the specification, this specification is called command. For example, customers want to change their own bank account password, if it is me, Yue Heyue after the specification only need to write Passwd,shell will prompt you to put your new password on the keyboard input, the shell will be forwarded to the kernel, if not himself, please obtain authorization, and in passwd The command followed by the name of the account you changed, such as passwd Centos,centos is what we call the command parameters. As for Shell programming is equivalent to the customer one-time write on the requirements of the vault operators, the vault operators can be completed back and forth, reducing the waiting, improve efficiency. Of course, as the operator, only need to fill in the form, do not need to translate the table into the shell and the kernel to communicate the "slang", which means that we do not need to compile.
The shell script's turtle Butt must have an opening field #! , called Shebang. Its name comes from Sharp and bang, respectively, to the name of #,! Two symbols for UNIX names. Equivalent to the above-mentioned analogy of the vault operator's work card, through this, the Treasury knows what the identity of the internal personnel, wearing a work card is the customer designated vault operator-usually/bin/bash, of course, customers can also specify other favorite, such as/BIN/CSH. A long string behind the operator is the customer's list of operational requirements.
Since Shell programming is called programming, it also counts as a language. For computer programming languages, there is a notion of a concept called a variable, which is similar to the X and Y in several sets of equations learned in junior high school. Also use the example of the Treasury for analogy, as the customer said I want to deposit a thing in the Swiss bank vault, but I do not know what kind of things to save, is the United States knife or gold bar, the Treasury first left me a bit. So the bank will be in the Vault store Things (memory) to the first space, since do not know what type, it is called a general name (type): Things (strings), always can not be wrong. As for the final deposit in and according to the needs of customers to take the United States knife investment value-added or gold bar to cash out (operation), the Treasury will be the type of implicit conversion.
Reproduced in Linux operation and maintenance tribe»shell and kernel understanding http://www.178linux.com/10366
Seen in Zhang Fei online blog
The understanding of shell and kernel