![]() |
Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh). Bash is the default shell for most Linux distributions. Generally speaking a shell is a user interface to the Linux operating system. It takes input from the user and interprets those command into instructions that the operating system can understand.
Bash is a character based interface. It takes it's instructions from standard input in textual form, and usually produces character based output.
The shell's job then is to interpret user input into commands understood by Linux. It breaks up the lines of the command into pieces, called words. It then interprets these words, according to rules. The shell sets up I/O according to the instructions in the commands. It finds the commands in the files and runs them with options given on the command line.
Each step is made of one or more substeps, each containing a particular instruction to the underlying operating system. The shell itself is not Linux, just the user interface to it. Unix is one of the first operating systems to make the user inerface independant of the operating system.
The shell can do more than just pass commands to the system for execution. The shell helps you use the computer. The shell is a command interpreter that can expand and change the commands according to built in rules. Of equal importance are wild-card and command connection operators that make the command line more general and flexible. The shell can take advantage of conditions in the environment, managed by the shell, to customise the way commands work.
Bash's command-line editing is one of the most powerful features. It's very easy to correct mistakes and modify previous commands to save time and keystrokes. Another major feature of bash is it's job control. Job control allows you to stop, start and pause any number of commands at the same time. You may wish to modify the characteristics of your environment, for this there are shell variables. A shell variable is a name with an associated value. Bash keeps track of several built-in variables. The convention is for shell variables to have names in all capital
letters. Bash-specific built-ins are, however defined in lowercase. The environmental variable will always be know by the subprocesses, however the shell needs to be told about other variables, options, aliases, etc., that are to be communicated to subprocesses. The way to do this is to declare them in the environment file. On Linux systems this is commonly the .bashrc file in the users home directory.
joe@localhost $ echo $MANPATH
/usr/man:/usr/X11R6/man:/usr/lib/perl5/man:/usr/share/perl5/man/