The shell is the command interpreter in an operating system such as Unix or GNU/Linux, it is a program that executes other programs. It provides a computer user an interface to the Unix/GNU Linux system so that the user can run different commands or utilities/tools with some input data.
When the shell has finished executing a program, it sends an output to the user on the screen, which is the standard output device. For this reason, it is referred to as the “command interpreter”.
The shell is much more than just a command interpretor, it is also a programming language of its own with complete programming language constructs such as conditional execution, loops, variables, functions and many more.
Shell script is a computer program designed to be run by the Unix shell, a command-line interpreter.
The various dialects of shell scripts are considered to be scripting languages.
Typical operations performed by shell scripts include file manipulation, program execution, and printing text.
A script which sets up the environment, runs the program, and does any necessary cleanup, logging, etc. is called a wrapper.
Just about every programming language in existence has the concept of variables - a symbolic name for a chunk of memory to which we can assign values, read and manipulate its contents.
The Bourne shell is no exception.
Note that there must be no spaces around the "=" sign: VAR=value works; VAR = value doesn't work.
The shell does not care about types of variables; they may store strings, integers, real numbers - anything you like.
Arithmetic operators in shell scripting are used to perform general arithmetic/ mathematical operations.
There are 7 valid arithmetic operators in shell scripting −
Addition (+) is used to add two operands (variables).
Subtraction (-) is used to subtract two variables (operands) in shell scripting.
Multiplication (*) is used to multiply two variables (operands) in shell scripting.
Division (/) is used to divide two variables (operands) in shell scripting.
Modulus (%) is used to find the remainder on division of operands in shell scripting.
Increment operator (++) is used to add one to the current value of the operator.
Decrement operator (--) is used to subtract one from the current value of the operator.