๐Ÿš€ Day 8 of #90DaysOfDevOps: Bash Scripting Basics ๐Ÿ–ฅ๏ธ

Naushad KhanNaushad Khan
2 min read

Today, I explored the essentials of bash scripting, covering key concepts step by step. Here's how I tackled each task, along with command-line examples:


๐Ÿ“ Task 1: Comments

  • What I Learned: Comments in bash scripts start with # and are used to explain what different parts of the script do.

  • Example:


๐Ÿ“ฃ Task 2: Echo

  • What I Learned: The echo command displays messages in the terminal. Itโ€™s a simple way to print text or variable values.

  • Example:


๐Ÿ’ผ Task 3: Variables

  • What I Learned: Variables in bash can store data that can be referenced by their name.

  • Example:


โž• Task 4: Using Variables

  • What I Learned: Variables can be used to perform operations like arithmetic.

  • Example:


๐Ÿ” Task 5: Built-in Variables

  • What I Learned: Bash has built-in variables that hold useful information, such as the script name ($0), the number of arguments ($#), and more.

  • Example:


โœจ Task 6: Wildcards

  • What I Learned: Wildcards (*, ?, [ ]) are used to perform pattern matching for file operations.

  • Example:

# List all files with a .txt extension in the current directory

# List all files starting with 'file' and ending in '.sh'



Day 8 was an exciting introduction to bash scripting, building a solid foundation for more complex tasks ahead. Canโ€™t wait to dive into advanced concepts in the coming days! ๐Ÿš€

#Day8 #BashScripting #DevOpsLife #LinuxLearning #Automation #ShellScripting #90DaysOfDevOps #TechGrowth #CommandLine

1
Subscribe to my newsletter

Read articles from Naushad Khan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Naushad Khan
Naushad Khan

DevOps engineer with a passion for automation, CI/CD, and cloud platforms like AWS. I bridge dev and ops, optimizing workflows and sharing insights through technical blogs. Letโ€™s automate the future! ๐ŸŒโš™๏ธ