Day 4 : Basics Of Shell Scripting For Devops
I am a DevOps Engineer with an aim to learn and contribute to the Tech World!!
📝 Blogging and Sharing: On this platform, I'll be sharing insightful articles, tutorials, and tips on all things DevOps. Expect deep dives into CI/CD best practices, IaC patterns, containerization strategies, cloud optimization, and much more. Let's learn and grow together!
⭐Day4 Task is about basics of Shell scripting⭐
⭐⭐Tasks⭐⭐
✔Explain in your own words and examples, what is Shell Scripting for DevOps
Shell Scripting is used by DevOps Engineer to automate their day-to-day task and if they want to run multiple Linux commands in a sequence then they create a shell script that contains all the Linux commands in a sequential manner
Shell scripting is also very useful if we want to execute a particular task then we can also create a shell script for that and it will be executed
whatever commands that we write in a shell script it will be picked up by the shell and then it will provide to the kernel and then the kernel will interact with the Hardware to perform that task
✔Write a Shell Script that prints I will complete the #90DaysOofDevOps challenge
Attaching the code below
#!/bin/bash
echo "I am going to complete My 90days devops challenge"
echo "Bye"
Attaching the output screenshot below

✔Write a Shell Script to take user input, input from arguments and print the variables.
Attaching the code below
#!/bin/bash
echo "Hi welcome to the Personal Data Application"
echo "can you please provide us your name and your city where you live"
read name
read city
sleep 2
echo "Thank you for providing the data"
sleep 2
echo "can you also confirm that your age is: ${1} that you have you already passed while opening this application "
echo "Now we are going to print your personal data"
echo "Name: ${name}"
echo "City: ${city}"
echo "Age: ${1}"
sleep 2
echo "Thank you Bye!!"
Attaching the code output below

✔Write an Example of If else in Shell Scripting by comparing 2 numbers
Attaching the code below
#!/bin/bash
echo "Enter Number: 1"
read num1
sleep 2
echo "Enter Number: 2"
read num2
if [ ${num1} -gt ${num2} ]
then
echo "Number 1 that is :${num1} is greater than :${num2}"
else
echo "Number 2 that is :${num2} is greater than :${num1}"
fi
sleep 2
echo "But you have missed to handle the case of equality "
sleep 2
echo "Bye"
Attaching the code output below

Kindly Leave your comments in the Technical Blog Post if you like
Happy Learning to All !!✌⭐
Thank you All!!
Amrit Manash

