Day 4 Task: Basic Linux Shell Scripting for DevOps Engineers.

Kernel:
The kernel is a computer program that sits at the heart of a computer's operating system and has total control over everything in the system.
It is a section of the operating system code that is always in memory and promotes interactions between hardware and software components.

Shell:
The shell is the command line interpreter in Linux.
It acts as a bridge between the user and the kernel, executing programs known as commands.
For example, if a user types ls, the shell runs the ls command. Other programs, such as applications, scripts, and user programs, can also be run via the shell. (e.g., written in Python or the shell programming language).

Linux Shell Scripting:
A shell script is a computer program that is meant to be executed by a Linux shell, also known as a command-line interpreter.
Scripting languages include the numerous dialects of shell scripts.
Shell scripts often conduct actions such as file manipulation, program execution, and text output.
Below is an example of how to create and run a shell script in Linux.

What is #!/bin/bash? can we write #!/bin/sh as well?
#!/bin/bash or #!/bin/sh has a name, known as "she-bang".It is also called as sh-bang, hashbang, poundbang or hash-pling.
On Unix-like Operating systems we have a choice of multiple shells.
The most frequent shell used as the default shell for Linux system user login is /bin/bash.
The name of this shell is an abbreviation for the Bourne-again shell because it has more functionality, is extensively developed, and has superior syntax.
Bash can run the great majority of scripts and is therefore frequently used.
/bin/sh is an executable representing the system shell and is usually implemented as a symbolic link pointing to the executable for whichever shell is the system shell, hence we can write #!/bin/sh as well.
Tasks:
Shell Script which prints
I will complete #90DaysOofDevOps challenge:
#!/bin/bash
echo "I will complete #90DaysOfDevOps challenge

Shell Script to take user input, input from arguments and print the variables.
#!/bin/bash
echo "welcome $@"
echo "what is your name"
read username
echo "welcome $username"
echo "what is your roll no"
read rollno
echo "your roll no is $rollno"

Example of If else in Shell Scripting
#!/bin/bash
echo "enter the file name"
read filename
echo "checking if $filename exists.."
if [ -f $filename ]
then
echo " $filename exists"
else
echo "$filename does not exist"
fi





