Bash Shell Scripting:- Lesson 1,2 &3 for DevOps Engineers.
Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers.
Course Content:
Lesson:-1 Introduction to Bash Shell Scripting.
Lesson:-2 Bash Shell Scripting Using Comments and Variables.
Lesson:-3 Bash Shell Scripting using Read Operator in Shell Scripts.
IMP We are Dividing the Terminal in 2 Parts Right Side Script Execution and Left Side Write a bash file with Syntax.
Lesson:-1 Introduction to Bash Shell Scripting.
Shell Scripting:-
A Shell Scripting is a basic program which we are written our commands and Interpret which are input form the user and give the output.It is used to Automate our Process. In our Linux default /bin/bash shell we are using. But we are using different shells in our Shell Scripting. you can direct execute the script do not compile the Script.
Practical Part
Present shell in our Linux.
How to change the shell.
Total shells in our Linux
How to check the shell level
How to change the shell
Binary file Available of Shell
Lets us discuss with help of Practical.
How to print the Value
Single Quote in Shell Script as a ties print
Double Quote in Shell Script print the value
Topic
Echo Command with backspace Character in Shell Script.
For New Line Print
echo -e Welcome to Shell Scripting Tutorials \nLesson1
For tab Space in Lines
echo -e Welcome to Shell Scripting tutorials \tLesson1 (For tab Space)
Now Move one step forward write a Shell Script.
Lesson:-2 Bash Shell Scripting Using Comments and Variables.
In Lesson 2 we will discuss the Comments, Variables and Dollar Sign
Comments and Variables.
Comments:-
#Sign(Pound sign) will be ignore by the shell it is used only for the Understanding shell do not read the #Comments.
#sign Practical on Normal Terminal
#sign Practical on File Terminal
Variables:
Variable is Container in which can store our value if we required in the shell we will call. Variable value can be changed. In our Shell Scripting 2 types of Variables we are using for Ex:-
1 System Variable
It is a Permanent Variables which are Developed by the Developer in our machine ant its value can not be changed. It is fixed it is Pre-Defined.
How to check the System Variables in our Linux. It is in the capital letters. Variable is a case sensitive
How to check the total No of System variable in our System.
How to check the total No of System variable in our System another way.
2 User Defined Variables:
Variables which are not fixed and we can change the value as per our need and save it into the variable and its defined in the shell if you are not export.
User defined variable are not start with Number like (123) you can used after
Let's discuss the Variables with the help of Practical
For Better Knowledge we will write a Script of System variable in the single file and Execute.
I Have used the 2 Terminals for theses Script (Right Side Execution the Script and Left Side Write a Script with Code.)
For Better Knowledge we will write a Script of User variable in the single file and Execute.
I Have used the 2 Terminals for theses Script (Right Side Execution the Script and Left Side Write a Script with Code.)
export:-
Export is used to set your variable Permanent in shell Scripting. you can set your variable on 2 types:
1 Entry on Terminal and we will check with in different-2 shells.
Lesson:-3 Bash Shell Scripting using Read Operator in Shell Scripts.
Read Operator:-
Take input form the user and store in the variable with the help of Read Operator. in these lecture we will use the Read Operator.
Let us discuss with the help of Single Input.
I Have used the 2 Terminals for theses Script (Right Side Execution the Script and Left Side Write a Script with Code.)
Let us discuss with the help of Multiple Inputs from the user.
In Multiple operators we will use the 4 names and execute the names.
To take the input form the user in same line
To take the input form the user Silent with read operator.
Array:-
To take the multiple inputs form the user you do not know how much inputs the user will be given and it stored on a single Array.
Hope I helped you in understanding the concept in a better way!!
Happy Learning !!
CKA certified | REDHAT OPENSTACK Certified |GCP-Associate cloud engineer certified| Docker | kubernetes | AzureDevOps | AWS | Linux | ansible | cicd | jenkins | terraform | Grafana | GIT |GITHUB
1yGood Initiative!!Maninder Singh
AWS || Huawei || Cloud || Docker || Mentor & Tutor || System Engineer Antier Solution
1y++