#90daysofdevops { Day -4}


Get ready for a thrilling ride on day four of my blogging journey as we unravel the power of Basic Linux Shell Scripting. π From automation to efficiency, each command holds the key to DevOps mastery! π»β¨ Thank you so much for all the shares and impression , it really boosted my LinkedIn account reach ππ©βπ»π
WHAT THE HECK IS KERNEL ?
The Heartbeat of Your System! ππ
Imagine your computer as a bustling city, and at its vibrant core is the Kernel β the ultimate maestro orchestrating everything! πΆ This superhero of software is the bridge between your hardware and software, managing tasks like a cosmic conductor guiding a symphony. ππ§ It handles requests, allocates resources, and ensures that your favorite apps run seamlessly β a digital guardian ensuring your computing journey is nothing short of spectacular! π So, next time you click, type, or game away, remember to salute the Kernel, the unsung hero behind the scenes!
_______________________________________________________________________________________
WHAT THE HECK IS SHELL ?
π Shell: Your Tech Magic Wand! β¨π»
he shell is not just a mundane interface; it's your gateway to a digital wonderland! πͺβ¨ Think of it as a powerful magic wand that lets you command your computer with a flick! πͺπ« The shell is your personal genie, ready to grant wishes in the form of executing commands, navigating files, and making your tech dreams come true!
_________________________________________________________________________________________
WHAT THE HECK IS LINUX SHELL SCRIPTING ?
π§π Linux Shell Scripting: Power in Simplicity!
Linux Shell Scripting is like your tech choreographer, choreographing a dance of commands! ππ» In simple terms, it's writing scripts to automate tasks, making your computer do tricks at your command. π€π§ Whether you're a coding maestro or a newbie, shell scripting is your backstage pass to streamlining tasks and unleashing efficiency! ππ
_________________________________________________________________________________________
Understanding #!/bin/bash vs. #!/bin/sh:
The shebang (#!/bin/bash
or #!/bin/sh
) is a directive at the beginning of a shell script that specifies the shell interpreter to be used. #!/bin/bash
indicates the Bash shell, while #!/bin/sh
typically points to the system's default shell. In many systems, /bin/sh
is a symbolic link to /bin/bash
, so they might behave similarly. However, if a script requires specific Bash features, it's recommended to use #!/bin/bash
.
Now, let's create the requested shell scripts:
1. Shell Script to Print a Message:
#!/bin/bash
echo "I will complete #90DaysOfDevOps challenge"
2. Shell Script to Take User Input:
#!/bin/bash
echo "Enter your name:"
read username
echo "Hello, $username! Welcome to the script."
3. Shell Script to Use Command Line Arguments:
#!/bin/bash
echo "The script name is: $0"
echo "First argument: $1"
echo "Second argument: $2"
4. Example of If Else in Shell Scripting:
#!/bin/bash
num1=5
num2=10
if [ $num1 -eq $num2 ]; then
echo "Numbers are equal"
elif [ $num1 -lt $num2 ]; then
echo "$num1 is less than $num2"
else
echo "$num1 is greater than $num2"
fi
Connect with me on LinkedInππ:https://www.linkedin.com/in/nikhil-kathale-27544a1b5/
Subscribe to my newsletter
Read articles from Nikhil Kathale directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
