Bash Tutorial (Shell Scripting)

Introduction – Bash Tutorial (Shell Scripting)

Bash is a GNU based UNIX shell and command language completely written in C programming language by Brian Fox in 1989. Bash also known as Shell Scripting or Unix Shell. Initially, it was available for only Linux distributions. But later on, the bash was started supported for macOS and Windows. This made this scripting language cross-platform. In this, Bash tutorial, we will learn how to program with a bash in details.

Typically bash runs in a command-line window where users tell a command to perform certain actions cause by bash or shell scripting. Bash has many modern scripting languages features like variables, conditional statements, looping for repeat certain things, iteration, dynamically scoped, etc.

Bash Program Structures & Procedures

You can execute a set of statements written in bash scripting from a bash script file with .sh extension. Or you can execute a single statement in the shell command line. The main use of bash scripting is command processing.  Using bash you can automate a lot of daily tasks that you probably do repeatedly.

Still now, many Linux and Unix distros are using bash as the default login shell. Moreover, the default command-line shell of Solaris is completely based on bash shell scripting.

Bash Commands

In the next subsequent chapters of this bash tutorial, we will learn many bash commands after learning the most basic syntax and running paradigm of bash scripting language. Commands like simple echo command in bash scripting consist of:

$ echo {1..10}
1 2 3 4 5 6 7 8 9 10

There are so many more commands and staff in bash. We will learn them in the later chapters.  So let’s start!