Skip to main content

What is Linux Shell scripting ? and Why Shell Scripts?


What is Shell Script?

Bunch of commands in a computer program which is run by the Unix Shell by the command line interpreter is called as Shell script.

A shell script usually has comments that describe the steps. The different operations performed by shell scripts are program execution, file manipulation and text printing.

A wrapper is also a kind of shell script that creates the program environment, runs the program etc.




Shell scripts are reduces the efforts required by the end use.



Follow below steps to create a shell script:

  1. Create a file using a vi editor (or any other editor).  Name script file with extension .sh
  2. Start the script with #! /bin/sh
  3. Write some code.
  4. Save the script file as filename.sh
  5. For executing the script type bash filename.sh


Why Shell Scripts?


As being set of Linux commands, a shell script can be used to achieve one or more tasks. For example, a script could be written to start a database, shutdown a database, start backup, check whether a specific service is up, and if not it could start it. So many other tasks can be done using shell scripts. In general, when a specific task is frequently needed, it is wise to write a script that can do it for you. This is much better than having to remember, and type the commands every time the task is needed (which is both silly and error-prone job). Writing shell scripts half-automates the administration tasks, saves the administrator’s time, and minimizes typos effects.


Advantages of Shell Script

Below are the few advantages of shell scripting:

  • The commands and syntax of the shell script are the same as that entered at the command line. Because of this, there is no need to switch to a completely different syntax.
  • It is much faster to write a code in shell script than in other programming languages. This also means that the program is easier to create and files required can be selected easily.
  • Shell script can also be used to provide linkage for already existing programs.
  • Shell scripting can be used by users that are not experts to modify and tailor the behavior of their programs according to their requirements.
  • Quickly Start
  • Interactive debugging

Disadvantages of Shell Script

Below are the few disadvantages of shell scripting:


  • There may be errors in shell scripting that prove to be quite costly.
  • The programs in shell script are quite slow while executing and a new process is required for every shell command executed.
  • Different platforms in shell scripting may also have compatibility problems.

Types of Shell


  • The Bourne Shell
  • The C Shell


Popular posts from this blog

How to Reset Steam Password? – Recover Your Steam Password

Are you suffering with Reset Steam Password? This blog will help you. What is Steam? Steam is the online website for getting the best games for paid. If you are a true game lover then you should have an active account on Steam. Many of people lost their password during the  PC clean-up  or any other circumstances. At that time they have to reset Password of all accounts. Then if you facing issues with the password, you forced to Steam reset password to access the Steam account. We are going to share the guide that how to recover your forgotten Steam Password and make your existing account ready. First of all, you should have enough knowledge about what is Steam and why Steam Account required? Why Steam Account Requires? Before jump into password recovery and Login details, let me clear about why Steam Account required? There are several benefits of this Steam Account from where you can easily download PC games as well as software. Though it will be p...

What is STP? - Explain Advantages and Disadvantages

The Spanning Tree Protocol is a network protocol that builds a loop-free logical topology for Ethernet networks. The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them. STP is a protocol. It actively monitors all links of the network. To finds a redundant link, it uses an algorithm, known as the STA (spanning-tree algorithm). The STA algorithm first creates a topology database then it finds and disables the redundant links. Once redundant links are disabled, only the STP-chosen links remain active. If a new link is added or an existing link is removed, the STP re-runs the STA algorithm and re-adjusts all links to reflect the change. STP (Spanning Tree Protocol) automatically removes layer 2 switching loops by shutting down the redundant links. A redundant link is an additional link between two switches. A redundant link is usually created for backup purposes. Just like every coin has two sides, a redundant link, along with...