What are Shells and Shell Scripting?

Introduction to Shell and Shell Scripting

Introduction to Shell and Shell Scripting

First of all, let us gather knowledge about the following terms:

  • Kernel
  • Shell
  • Terminal

What is a Kernel?

Kernel is called the core of an operating system. Kernel is a layer of program in an operating system which connects the operating system with the machine's hardware. Some of the tasks which are handled by Kernel are listed:

  • Memory Management
  • Device Management
  • Process Management
  • Input/Output Operations

What is a Shell?

Shell is a program that acts as an interface between the user and the Operating System. Shell reads commands through the scripts which are input by human users and then it converts them into Kernel readable form.

What is a Terminal?

Terminal is an application program which allows the users to interact with the shell. Terminal program on Linux/MacOS is called Terminal itself and in Windows it is called Command Prompt and there is also a PowerShell in Windows which is a Terminal Program.

What is Shell Scripting?

While explaining Shell in this page itself, it is stated that "Shell reads commands through the scripts which are input by human users". This should be a question that how does Shell understands what the user is trying to convey and then processes it into Kernel friendly commands. This is exactly when Shell Scripting steps in.

Shell Scripting is like a language which Shell can understand, either we put those scripting commands on Terminal or we make script files of them and run them.

There are numerous Shells and have different scripting, a few of them are listed here:

  • Bourne Shell: The original shell which is simplest and very fast shell but could not meet the modern features. It is denoted by the .sh extension.
  • Bash(Bourne-again Shell): It is the most popular and mostly widely used shell and it is also the default shell in Linux operating systems. It is a refined product of the original Bourne Shell. It has features of Korn and C Shell also.
  • C-Shell: C-Shell is a shell which offers syntax very similar to the C programming language. It also has an improved version of itself which is Tenex C-Shell. C-Shell is denoted as .csh and  Tenex C-Shell is denoted as .tcsh.
  • Korn Shell: It offers powerful programming features and also, it has features of both Bourne Shell(.sh) and C-Shell(.csh).

Conclusion

It is learnt from all the above content that Shell Scripting is something through which we interact with the Shell and then whatever we convey to the shell, Shell converts it into the Kernel Readable form and then Kernel performs it's work according to the commands, and the program through which we interact with the Shell is called Terminal. Bash is the default shell in Linux Distributions and Bash Scripting is the most Widely used Shell Scripting language.

Comments