Skip to content

Welcome to the Bash Scripting Repository! This repository contains various Bash scripts and examples to automate tasks, manage systems, and improve productivity.

License

Notifications You must be signed in to change notification settings

nkrgupta999/bash-scripting

Repository files navigation

Bash Scripting

Welcome to the Bash Scripting Repository! This repository contains various Bash scripts and examples to automate tasks, manage systems, and improve productivity.

Disclaimer

Please note that the information contained in this repository is provided for informational purposes only. We make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the information contained in this repository for any purpose. Any reliance on such information is therefore strictly at your own risk.

Introduction

Bash scripting is a powerful way to automate tasks in Unix/Linux environments. Whether you're a beginner or an advanced user, this repository has something for you. Explore a collection of scripts categorized by functionality.


Prerequisites

Before using the scripts, ensure the following:

  1. A Unix/Linux-based operating system (e.g., Ubuntu, Fedora, macOS).
  2. Bash shell (version 4.0 or later is recommended).
  3. Basic knowledge of shell commands.

Getting Started

  1. Clone the repository:

    git clone https://github.com/your-username/bash-scripting.git
    cd bash-scripting
  2. Make scripts executable:

    chmod +x script_name.sh
  3. Run the script:

    ./script_name.sh

Table of Content

  • Hello World
  • Variable
    • Normal variable
    • Constant (Readonly) variable
  • Comments
    • Single line comment
    • Multi-line comment
  • Array
    • Array creation
    • Array Declaration
    • Accessing elements
    • Accessing From particular indexing
    • Accessing from particular indexing with several elements count
  • Associate Array
    • Declaration of associate array
    • Entering the single key-value pair at a time
    • Entering the multiple key-value pair at a time
  • String
    • String Declaration
    • String Accessing
    • Length of the string
    • Replace the Full OR Substring
    • Extract OR slice the sub-string
    • Convert into Upper case
    • Convert into Lower case
  • User Input
    • without prompt
    • with prompt
  • Operator
    • Arithmetic Operator
      • Using let keyword
      • Using the (( )) symbol with arithmetic and expression operations
    • Comparison Operator
      • Equal to
      • Greater than
      • Greater than equal to
      • Less than
      • Less than equal to
      • Not equal to
    • Logical Operator
      • AND Operator
      • OR Operator
    • Ternary Operator
  • Conditional Statement
    • If statement
    • If-Else statement
    • Elif (else-if) statement
    • Case statement (choice-based)
  • Looping Statement
    • for loop
      • for loop with array and range
    • while loop
    • until loop
    • Infinite loop
      • for infinite loop
      • while infinite loop
      • until infinite loop
    • select loop
  • Function
    • Function decleration
    • Function calling
    • Basic function
    • parameter / agrument function
    • default parameter / argumnet function
    • recursion function

Contributing

Contributions are welcome! Follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Add feature description"
  4. Push to your branch:
    git push origin feature-name
  5. Open a pull request.

License

This repository is licensed under the MIT License. See the LICENSE file for details.

Code of Conduct

Terms and Conditions

LinkedIn

https://www.linkedin.com/in/nkrgupta999

Connect

https://linktr.ee/nkrgupta999

Happy scripting! 🎉

About

Welcome to the Bash Scripting Repository! This repository contains various Bash scripts and examples to automate tasks, manage systems, and improve productivity.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages