LinuxAdminToolkitLinuxAdminToolkit
Home
Guide
About Me
GitHub
Home
Guide
About Me
GitHub
  • Administrator's Manual

    • Commands
      • Basic Commands
      • File Management
      • Process Management
      • User and Group Management
      • System Information
      • Disk Usage
    • Networking
      • IP Address
      • Subnetting
      • Routing
      • Firewall
      • Network Tools
    • Services
      • Service Management
      • Service Configuration
      • Common Services
    • Monitoring and Logging
      • System Monitoring
      • Log Management
      • Monitoring Tools
      • Log Analysis Tools
    • Shell Scripting
      • Basic Shell Script Structure
      • Variables
      • Control Structures
      • Functions
      • Input and Output
      • Debugging and Error Handling
      • Advanced Topics
    • Configurations Files
      • System Configuration Files
      • Network Configuration Files
      • Service Configuration Files
      • Application Configuration Files
      • Editing Configuration Files
      • Backup and Restore Configuration Files

Basic Shell Script Structure

Shebang

  • Every shell script starts with a shebang (#!) followed by the path to the interpreter.
#!/bin/bash

Hello World Script

  • We can save this as hello.sh, make it executable with chmod +x hello.sh, and then run it with ./hello.sh.
#!/bin/bash
echo "Hello, World!"
Edit this page on GitHub
Last Updated:
Contributors: Jenil Gajjar, jenilgajjar20
Next
Variables