LINUX BASH SHELL

  • A shell is a program that sits between you and the LINUX operating system.
  • In the next segment, we will study Bash (Bourne Again Shell) that is compatible with Bourne shell (unix default shell) and borrows the best features from the other shells. Bash is becoming the most popular shell – it is the default shell in Linux.
  • It makes basic facilities such as multitasking and piping easy to use, and it adds useful file-specific features such as wildcards & I/O redirection.
  • A hierarchy diagram below shows the features of a bash shell.

 

Bash Shell Hierarchy with functions
Bash Shell Hierarchy with functions

 

Linux has a variety of different shells:

  Bourne shell (sh), C shell (csh), Korn shell (ksh), TC shell (tcsh), Bourne Again shell (bash).

SHELL OPERATIONS: When a shell is invoked, either automatically during login or manually from a keyboard or script, it follows a preset sequence:

  1.  It reads a special startup file, typically located in the user’s home directory, that contains some initialization information. We’ll leave the specific details for later.
  2.  It displays a prompt and waits for a user command.
  3.  If the user enters a Control-D character on a line of its own, this command is interpreted by the shell as meaning “end of input”, and it causes the shell to terminate. Otherwise, the shell executes the user’s command an returns to step 2.
To find out the full pathname of your current login shell is to type the following:

   echo  $SHELL 

   /bin/bash full pathname of the bash shell.

    echo  is the command  to display or print

   SHELL  is a variable

    $    is used to dereference the value of the variable