Skip to content

A collection of Bash scripts I wrote while learning from a YouTube tutorial.

Notifications You must be signed in to change notification settings

shreyans413/bash-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Bash Scripts for Syntax Reference

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.


📂 Folder Structure

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

🛠️ How to Use These Scripts

  1. Clone the repository
    git clone https://github.com/shreyans413/bash-scripts.git
    cd bash-scripts

  2. Run a script
    bash script_name.sh

  3. Make scripts executable (optional)
    chmod +x script_name.sh
    ./script_name.sh

Topics Covered

✅ 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

Why I Created This Repo

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! 🚀

Contributions & Feedback

  • If you have suggestions, feel free to open an issue or submit a pull request.
  • If you found this helpful, star ⭐ the repository!

License

No specific license is applied. You are free to use and modify these scripts for personal or educational purposes.

About

A collection of Bash scripts I wrote while learning from a YouTube tutorial.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages