Linux Learning Articles (5) - What is Shell?

What is a shell?    

The shell is a special-purpose program, which is mainly used to read commands input by the user and execute corresponding programs in response to the commands. Sometimes, people also call it a command interpreter. The term login shell (login shel) refers to the process created by the system to run the shell when the user first logs in to the system.

 

Although some operating systems integrate the command interpreter into the kernel, for UNIX systems, the shell is just a user process. There are many types of shells, and different users who log in to the same computer can use different shells at the same time (the same is true for a single user). Throughout the history of UNIX, the following important shells have appeared

  • Bourme shell (sh): This shell written by Steve Boure has the longest history and is widely used. It was once the standard shell of the seventh edition of UNIX. The Boume shell includes many features commonly found in other shells, I0 redirection, pipes, filename generation (wildcards), variables, environment variable handling, command substitution, background command execution, and functions. All implementations of UNIX after the seventh edition ship with the Boume shell, in addition to possibly other shells.

 

 

  • C shell (csh): Written by Bill Joy at UC Berkeley. Its name comes from the fact that the flow control syntax of the scripting language has many similarities with the C language. The C shell offered several very useful interactive features at the time that were not supported by the Bourne shell, including command history, command-line editing capabilities, mission control, and aliases. The C shell is not compatible with the Bourme shell. Although the C shell used to be the standard interactive shell on BSD systems, people generally prefer to write shell scripts for the Boume shell (described later) so that it can be ported across all UNIX implementations.

 

  • Kom shell (ksh): David Kom of AT&T Bell Labs wrote this shell as the "successor" of Boume shell. While maintaining compatibility with the Boure shell, the Kom shell also absorbs interactive features similar to those of the c shell.

 

  • Boume again shell (hash); This shell is a reimplementation of the Bourme shell by the GNU project. Bash: Provides interactive features similar to C sell and Kom shell. Brian Fox and Chet Ramey are the primary authors of bash . bash is probably the most widely used sell on Linux. On Lioux, Boumesel (sh) is actually provided by bash emulation.


     The purpose of designing the shell is not only for human-computer interaction, but also for line interpretation of shell scripts (text files containing shell commands). To accomplish this, every shell has built in many features usually associated with programming languages, including variables, loops and conditional statements, I/O commands, and functions. 

     Despite differences in syntax, each shell performs roughly the same tasks.


 

Guess you like

Origin blog.csdn.net/qq_41899773/article/details/103914859