Shell Scripting basically is a series of commands given to shell for its execution. From Writing any command to reading and executing it all can be done with the help of shell scripting. We can run a single executable command or a series of commands that are given as input to the shell for various output related executions anytime.
Kernel being the internal part of an OS that communicates with hardware and software uses the shell as the outer part to communicate with the user. We give inputs in the form of scripts, command, etc and execute it for the desired results.
Why Shell Scripting?
Shell scripting provides us with proper command and a platform to execute the commands with the desired input and generate the output needed. It works as a mediator to talk with the system kernel and various OS components.
We can simply think it as of a path or a way to a door that connects with the room we need for. So basically having the knowledge for shell scripting will ease the way we are willing to execute our commands further. We can start or stop any application together by just writing a simple script or we can initialize anything needed at the boot time with the help of shell scripting. It reduces the effort of a user by writing a series of commands at once.
Types of Shell Scripts
There are majorly two types of shell scripts:- BASH and C Shell
Bourne again shells (BASH) is the default shell having $ as its prompt, it is the most popular shell used for creating and executing shell commands.
C Shell is capable enough to read file commands and character prompting C shell is %
Applications of Shell Scripting
Shell Scripts are used for many purposes some of them are like:-
Execution of any batch job.
Execution of any run on startup.
Running a program.
Linking of directories and files over.
Routine task execution.
Monitoring of Jobs.
Kernel level communication.
Root dir operations.
Let us see a simple example for Shell Scripting:-
echo "Hello this is the Demo Run"
Simply saving the file with Demo.sh and running this will print on Hello this is the Demo Run on the terminal.
Programmers having good knowledge over script writing, Linux, Unix and kernel systems in OS will find it easy to understand and write scripts. Having knowledge over loops and basic variable command makes this shell scripting easy and understandable.
For the reader, you should have a basic knowledge of kernel and Linux and Unix. How to implement a logic and normal variables values used would be an added advantage.