Skip to main content

Command Palette

Search for a command to run...

Shell Scripting

Day 1 of Shell Scripting

Updated
2 min readView as Markdown
A

Hi, I’m Arpit Jain, a recently graduated student passionate about exploring the world of technology. Currently, I’m diving into DevOps—a new and exciting field for me! I’m documenting my learning journey through daily blogs, sharing my experiences, insights, and challenges as I grow. This “learn in public” approach is my way of staying consistent, building connections, and creating value for others who are also navigating their own paths in tech. Whether you’re an experienced professional or just starting out, let’s learn and grow together. When I’m not exploring DevOps, you’ll find me curious about other tech innovations and brainstorming how to turn ideas into reality. Let’s connect and make this journey collaborative and fun! 😊

Welcome to Day 6 of my DevOps journey! Today marks the beginning of an exciting sub-journey into the world of shell scripting. This is an essential skill for any aspiring DevOps professional, and I couldn’t be more thrilled to share what I’ve learned.

Why Learn Shell Scripting?

Shell scripting is the art of automating tasks in the Unix/Linux shell. It allows us to:

  • Simplify repetitive tasks

  • Create powerful tools for system administration

  • Orchestrate complex workflows

  • Enhance productivity and efficiency

Mastering shell scripting is a stepping stone to effective DevOps practices, as it lays the foundation for automation and scripting workflows.

What I Covered Today

I focused on the basics of shell scripting, progressing up to the concept of arrays. Here’s a detailed breakdown of my learning:

1. Introduction to Shell Scripting

Shell scripting involves writing scripts (text files) containing a sequence of commands to be executed by the shell. I explored the following foundational concepts:

  • What is a Shell? The interface between the user and the operating system.

  • Popular Shells: bash, sh, zsh, etc.

  • Creating a Script:

    • Use a text editor (e.g., nano, vim).

    • Save the script with a .sh extension.

    • Make it executable using chmod +x.

  • Running a Script: Execute it with ./script_name.sh.

2. Basic Shell Script Syntax

I learned the fundamental building blocks of a shell script:

  • Comments: Use # to add comments.

  • Variables: Store and manipulate data.

  • Displaying output: echo.

3. Working with Arrays

Arrays allow storing multiple values in a single variable. I explored:

  • Defining Arrays

  • Accessing Elements

  • Array with key value pair

That’s all from my day 6 update my plan for tomorrow is to learn the control flow, reading input, loop and to create some basic projects.