Skip to content

Shell Scripting

What is Shell?

Quoting from wikipedia

A Unix shell is a command-line interpreter or shell that provides a traditional Unix-like command line user interface. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute, or by creating text scripts of one or more such commands. Users typically interact with a Unix shell using a [terminal](readme.md) emulator, however, direct operation via serial hardware connections, or [networking](../foundations/networking/README.md) session, are common for server systems. All Unix shells provide filename wildcarding, piping, here documents, command substitution, [variables](../devops/terraform/core-concepts/variables.md) and control structures for condition-testing and iteration
  • Interprets user commands
    • from terminal, from a file or as a shell script
    • expand wildcards, command/variable substitution
  • Command history, command completion and command editing
  • Managing processes
  • Shell variables to customize the environment
  • Difference between shell, tty and console

Like any indispensible software, Shell has undergone transformation from the days of basic sh shell that was used in 1970s Unix. While bash is default shell in most distros and most commonly used, powerful and feature rich shells are still being developed and released

  • sh bourne shell (light weight Linux distros might come with sh shell only)
  • bash bourne again shell
  • csh C shell
  • tcsh tenex C shell
  • ksh Korn shell
  • zsh Z shell (bourne shell with improvements, including features from bash, tcsh, ksh)
  • cat /etc/shells displays list of login shells available in the current Linux distro
  • echo $SHELL path of current user's login shell

Further Reading

Shell Customization

Original Content and Authors