This repository contains various Bash scripts that I wrote while learning Bash from a YouTube tutorial. The scripts cover essential Bash concepts, including loops, conditionals, functions, and more. I plan to use these as a syntax reference for future projects.
Each script focuses on a specific Bash feature:
File Name | Description |
---|---|
01_basic.sh | Basic syntax and script structure |
02_comments.sh | How to add comments in Bash |
03_vardemo.sh | Variable declaration and usage |
05_arrays.sh | Working with arrays in Bash |
10_if-else.sh | If-else statements |
15_forloop1.sh | For loop examples |
18_while_demo.sh | While loop examples |
24_functions_demo.sh | Defining and using functions |
26_args.sh | Handling command-line arguments |
30_connectivity_check.sh | Check internet connectivity using Bash |
33_root_usercheck.sh | Checking if the script is run as root |
... and more! | 🚀 Full list in the repository |
-
Clone the repository
git clone https://github.com/shreyans413/bash-scripts.git
cd bash-scripts -
Run a script
bash script_name.sh -
Make scripts executable (optional)
chmod +x script_name.sh
./script_name.sh
✅ Variables & Constants
✅ Arrays & Key-Value Pairs
✅ String Manipulations
✅ Arithmetic & Logical Operations
✅ Conditional Statements (if-else, case)
✅ Loops (for, while, until)
✅ Functions & Command-line Arguments
✅ File Handling & Redirection
✅ Debugging Techniques
I was learning Bash scripting from a YouTube tutorial and coded along with the video. These scripts help me quickly recall syntax and logic whenever needed.
Feel free to use them as a reference or modify them for your own projects! 🚀
- If you have suggestions, feel free to open an issue or submit a pull request.
- If you found this helpful, star ⭐ the repository!
No specific license is applied. You are free to use and modify these scripts for personal or educational purposes.