Script
📝 Basic Script Structure
Script Basics
#!/bin/bash # Shebang - defines shell to use
# Script description here
# Author: Your Name
# Date: YYYY-MM-DD
# Variables
NAME="John"
AGE=25
# Main script content
echo "Hello, $NAME!"Running Scripts
# Make script executable
chmod +x script.sh
# Run script
./script.sh
bash script.sh
source script.sh # Run in current shell🔄 Variables and Data Types
Variable Declaration
Special Variables
🔍 Control Structures
Conditional Statements
Loops
📊 Functions
Function Declaration
Function Libraries
📥 Input/Output
User Input
File Operations
🛠️ String Operations
String Manipulation
Pattern Matching
🔢 Arithmetic Operations
Using expr
Using $(( ))
For float numbers use bc
bcArithmetic operations with variable
Equals operators
Operator
Description
Example
Description
Basic Math
🐛 Debugging
Debug Options
💡 Best Practices
📋 Script Template
Last updated