This repository contains a collection of simple Bash scripts, each demonstrating a fundamental concept of shell scripting.
-
Clone the repository:
git clone <repository-url>
-
Navigate to the script's directory:
cd bash-scripting/scripts
-
Make any script executable:
chmod u+x script_name.sh
-
Run the script:
./script_name.sh
Script Name | Description |
---|---|
shelltest.sh |
Prints a simple "Hello World!" message to the console. |
variables.sh |
Shows how to declare and use variables. |
positionalarguments.sh |
Demonstrates how to use positional arguments passed to the script. |
interactiveshell.sh |
Illustrates how to create an interactive script that reads user input. |
ifelifelse.sh |
Provides an example of the if-elif-else conditional structure. |
case.sh |
Shows how to use the case statement to handle multiple conditions. |
arrays.sh |
Explains how to define and access elements in an array. |
forloop.sh |
Demonstrates a for loop that iterates over the items in an array. |
firstfunction.sh |
Teaches how to define and call a simple function. |
functionposargu.sh |
Combines functions with positional arguments and return codes. |