Skip to content

Programmedartemis/bash-scripting-labs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash Scripting Labs (1–9)

Overview

This repository contains a structured collection of Bash scripting exercises completed as part of my Linux and DevOps learning journey. The labs progress from beginner to intermediate level, building core skills in shell scripting, Linux commands, automation, and system interaction.


What I Learned

Through these labs, I practiced and developed skills in:

  • Bash scripting fundamentals
  • Variables and user input
  • Command-line arguments and positional parameters
  • Arrays (indexed and associative)
  • Conditional statements (if, elif, else, case)
  • Loops (for, while, select)
  • File handling and permissions
  • Input/output redirection and pipes
  • Debugging (set -x, set -euo pipefail)
  • Functions and modular scripting
  • Logging and error handling
  • Basic system automation

Projects Included

Lab 1: Hello World Script

  • Basic script structure
  • Shebang usage
  • Output and system date

Lab 2: Variables and Operations

  • Variable declaration
  • Arithmetic operations
  • Parameter expansion

Lab 3: User Input

  • Reading user input
  • Password masking
  • Input validation

Lab 4: Command-Line Arguments

  • Positional parameters
  • Argument validation
  • Script usage checks

Lab 5: Arrays

  • Indexed arrays
  • Associative arrays
  • Looping through arrays

Lab 6: Conditional Statements

  • File checks (-f, -d, -r)
  • Numeric validation
  • Case statements

Lab 7: Loops

  • For, while, and select loops
  • Menu-driven program
  • File reading line-by-line

Lab 8: Redirection & Debugging

  • stdout and stderr redirection
  • Pipes
  • Strict mode (set -euo pipefail)
  • Debugging techniques
  • Cleanup using trap

Lab 9: System Tool Project

A complete interactive system administration tool featuring:

  • User greeting system
  • System information display (uptime, df -h)
  • File backup utility
  • Password generator
  • Menu-driven interface
  • Logging system
  • Error handling and validation

How to Run

Make sure you are in a Linux/WSL environment:

chmod +x script_name.sh
./script_name.sh

Or run directly with Bash:

bash script_name.sh

Tools Used

  • Ubuntu (WSL)
  • Bash Shell
  • Git & GitHub
  • Linux command line utilities

Purpose

This repository demonstrates my progress in learning Linux shell scripting and system automation, forming a foundation for DevOps and backend engineering skills.


Author

Christopher Cynthia

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages