The basics of Bash Shell Scripting.

The basics of Bash Shell Scripting.

Introduction

Linux shell scripting is the definitive way to automate the execution of multiple commands through .sh files.

It is beneficial to avoid repetitive execution of commands and schedule specific tasks for timely execution. This is where a Bash shell comes into play.

Let's explore the vast applications and uses of scripting. There are countless ways to utilize this powerful tool, so let's get started.

What is a Bash shell?

The shell is a program that provides the Linux command line interface.

While users can configure other shells, many prefer to stick with the default shell. In most Linux distributions, the default shell is the GNU Bourne-Again Shell (bash), which has succeeded the Bourne shell (sh).

Command to check the available shell type is

cat /etc/shells

What is a Bash Script?

Bash script contains a series of commands written in a file. The bash program reads and executes these commands. The program runs through each line of code sequentially. One of the advantages of shell scripting is that it enables us to run multiple commands simultaneously. This can help in improving efficiency and saving time. It is possible to execute multiple commands at the same time.

The file extension would be .sh.