- So what is a shell script all about?
Well, a shell script
can be as simple as the number of commands
that are sequentially executed.
It's to automate your job
and to make it a little bit easier for you
to get things done.
Scripts normally work with variables
to make them react differently in different environments.
And when we talk about variables,
think about the path variable, for instance,
which is a system variable,
or an environment variable as we call it.
And by referring to it,
you can dynamically use values
that are different in different locations
and also in scripts conditional statements
such as fur, if, case, and while can be used
to make it more flexible.
So shell scripts are common
as they are easy to learn and implement,
and they are a part of the Linux operating system.
Also, a shell will always be available
to interpret code from the shell script.
If the scripts use internal commands only,
they are very fast as nothing needs to be loaded.
Everything is already in memory if it's a bash command,
and there is no need to compile anything.
There are also no modules to be used in the bash script,
and that makes them rather static.
Also, bash shell scripts are not item potent.
So shell scripts are very nice,
but in some cases, you might want to use something else
like Python or like Ansible
if it's about configuration management.