Why do we need shell scripting?

Shell is a software program that acts as a mediator between the kernel and the user. It reads the commands and interrupts by sending requests to execute a program. So, the shell is known as a command interpreter.

It contains almost 100 system calls. It tells the kernel to carry out various tasks for the program. These tasks are as follows −

  • Opening a file.

  • Writing a file.

  • Obtaining information about a file.

  • Executing programs.

  • Terminating a process.

  • Changing the priority of processes.

  • Getting the time and date.

Need of shell scripting

Let us see the reasons for using shell scripts which are given below −

  • Shell helps in doing work which is repetitive in nature. For example: When executing a bunch of commands, often, shells can take all these commands directly from a stored file and execute it, instead of writing them again every time.

  • They are used to get routine backups by admins.

  • They are easier to write and debug than other programming languages like C or C++.

  • We can transfer the shell script to other UNIX and similar operating systems and execute.

  • Shell scripts are also used to monitor systems regularly.

Now let us see different shells used in different operating systems, which are as follows −

The shells used on Linux operating system are as follows −

  • The Korn Shell,

  • Bourne-Again Shell,

  • Tcsh

The shells used on UNIX operating system are as follows −

  • The Korn Shell

  • The C Shell

  • Bourne-Again Shell

The shells used on Windows operating system are as follows −

  • Aston Shell

  • Window Blinds

  • Xoblite