A structured, hands-on repository covering foundational to advanced Bash Shell Scripting, Linux automation, and command-line programming.
The scripts are organized into modular, progressive learning modules:
Bash_Scripting/
├── 01_Basics/ # Variables, user input, arguments, comments
├── 02_Conditionals_and_Logic/ # if-else, case statements, file tests, comparison operators
├── 03_Arithmetic_and_Arrays/ # Integer math, floating point (bc), indexed arrays
├── 04_Loops/ # while, until, for, select loops, file reading, break/continue
├── 05_Functions/ # Function definitions, parameter passing, local variables
├── 06_Advanced_and_Debugging/ # Signals & traps, readonly variables, debugging techniques
├── Exercise/ # Hands-on problem sets & mini-projects (Sysinfo, Digital Clock, etc.)
└── practice/ # Practice task solutions & test outputs
1_hello.sh– Shebang (#!/bin/bash) and basic script output (echo)2_comments.sh– Single-line (#) and multi-line comments3_variables.sh– Variable assignment, naming rules, and expansion4_user_input.sh– Reading interactive terminal input (read)4_user_input_sameline.sh– Prompting input on the same line (read -p)4_read_without_var.sh– Utilizing the default$REPLYvariable4_multipleinput_stored_array.sh– Reading space-separated values into an array (read -a)5_pass_arguments.sh– Positional parameters ($1,$2), argument count ($#), and all arguments ($@,$*)
6_if_statement.sh– Basic conditional tests6_if_else_statement.sh– Two-way conditional branching6_if_elif_statement.sh– Multi-branch decision ladders7_integer_comparsion.sh– Integer comparison operators (-eq,-ne,-gt,-lt,-ge,-le)7_string_comparsion.sh– String equality, inequality, and empty checks (-z,-n,=,!=)8_file_test.sh– File attribute checks (-e,-f,-d,-r,-w,-x)8_append_text_toEOF.sh– Appending output and Here-Documents (cat << EOF)9_logical_and.sh– Logical AND evaluation (&&,-a)9_logical_or.sh– Logical OR evaluation (||,-o)11_case_statement.sh– Multi-branch pattern matching usingcase11_case_example.sh– Practical menu-driven selection usingcase
10_arithmetic_operations.sh– Integer arithmetic evaluation ($(( ... )),expr)10_arithmetic_op_float.sh– Floating-point calculations viabc(basic calculator)12_array.sh– Array indexing, length (${#arr[@]}), slicing, and iteration
13_while_loop.sh– Standard condition-drivenwhileiteration13_sleep.sh– Execution delays withsleepinside loops13_open_terminal.sh– Process launching and multi-terminal spawns13_read_file.sh– Reading files line-by-line using awhileloop13_readfile_IFS.sh– Preserving whitespace with custom Internal Field Separator (IFS)13_factorial.sh&14_factorial.sh– Iterative factorial calculations14_until_loop.sh– Running loops until a condition evaluates to true15_for_loops.sh– Range ({1..10}) and list-basedforiteration15_forloop_cmds.sh– Iterating over command output16_select_loop.sh– Generating interactive numbered menus withselect17_break.sh&17_continue.sh– Loop interruption and cycle skipping
18_functions.sh– Function syntax and call semantics18_passing_argument_fun.sh– Function arguments and return status19_local_variable.sh– Scope isolation withlocalvariables19_Example.sh– Modular function architecture
20_read_only_cmd.sh– Locking variable and function mutability (readonly)21_signals_traps.sh– Intercepting OS signals (SIGINT,SIGTERM) withtrap22_debug_script.sh– Shell debugging modes (set -x,set -e,bash -x)
- Contains 19 challenge scripts: System Information tool (
19_sysinfo.sh), Digital Clock (17_Digital_Clock.sh), Command-line flag parsing (14_getopts_statement.sh), Number reversal, and text search tools. - 10 multi-step practice tasks for shell automation workflows.
- Make any script executable:
chmod +x 01_Basics/1_hello.sh
- Run directly:
or with bash:
./01_Basics/1_hello.sh
bash 01_Basics/1_hello.sh