DAY-1 of Bash Blaze Challenge: From Zero to Bash Hero!
#BashBlazeChallenge #batch-8 #TrainWithShubham #ShubhamLondhe
As someone who’s always eager to dive into new learning experiences, joining the #BashBlazeChallenge led by #ShubhamLondhe was a no-brainer! Batch-8 is ongoing with lots of sharpening skills and is testing the limits of creativity through scripting. Here’s a little insight into the challenge!
Challenge Title: First day of Scripting
Challenge Scenario:
Participants were tasked with creating a bash script that performs a variety of tasks, from simple echoes to using wildcards and built-in variables. This was a real-world problem scenario designed to help us develop scripts that solve day-to-day automation tasks.
Challenge Objectives:
Write clean and well-documented bash scripts.
Use variables and built-in variables efficiently.
Perform arithmetic operations using input variables.
Leverage wildcards to list specific files.
Understand and apply commenting and echo commands.
Step-by-Step Instructions for the Challenge:
Task 1: Use of Comments help explain what the code is doing. I added comments throughout the script to ensure that even a beginner can follow along.
Task 2: Use of Echo
Task 3: Variables Declaring and assigning variables in bash is straightforward. For this task, I took user inputs for two numbers.
Task 4: Using Variables I created a script that prompts for two numbers, sums them, and prints the result using echo.
Task 5: Using Built-in Variables I utilized three bash built-in variables: $BASH, $BASH_VERSION, $PWD
Task 6: Wildcards: Listing files in a particular Directory.
Solution Details:
Here’s the bash script I came up with:
Conclusion:
This challenge not only improved my understanding of bash but also showed me the beauty of automation in scripting.
You can check out my solution on GitHub: shinagupta/BashBlaze-7-Days-of-Bash-Scripting-Challenge