As with any Programming or Scripting Language, let us take a look at the very basic two lines script called "Hello World!" in Bash!
The best way to learn and write Shell Scripts is by making use of editors like vi or nano, in this example, we will make use of nano,
Step by Step Hello World! Bash Scripting Example
- Open Terminal,
- Type nano helloWorld.sh and press enter, this will open Nano Editor for you,
- Write the below code,
#!/bin/bash echo Hello World!
- Press Control + X and then Y to save.
- Now run command chmod +x helloWorld.sh just to make sure we can execute this script,
- Type ./helloWorld.sh

Congratulations! You ran you first bash script successfully!
More Posts related to Bash,
- Bash Hello World! Script Tutorial
- How to run bash command in background
- How to create new user account in Windows bash
- How to Compare Strings in Bash
- Bash: Allow Command to Fail without exiting Script
- Fix bash: script.sh: Permission denied Error
- Bash getopts Command Example
- How to fix bash ping command not found error
- How to add NewLine Character in Bash Script String
- How to Echo Bash Command to a File
- Bash Command to Find String in a File
- How to open new Terminal using Bash Command
- Bash How to Save Output of a Command to a Variable
- Download a SSL Certificate from a URL in Terminal
- Bash Command to Check IP Address
- Know Bash shell version command
- Bash Command To Check If File Exists
- How to run a Command in Bash Script
- How to Compare two Files in Bash Shell
- How to check if a variable is set in Bash Script or Not
- Convert String from uppercase to lowercase in Bash
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command
- Bash Command To Get Current Time
- Bash command to List Files
- Fix: bash: syntax error near unexpected token
More Posts:
- Python Hello World! Program with code example (snippet) - Python
- Mac - Chrome Open a new window in Incognito mode - Chrome
- Mac: How to Insert a Row in Excel - Microsoft
- Java: Convert String to Binary - Java
- Zsh Shell: Custom alias that you may find useful - MacOS
- Fix: KeyError: exception in Python - Python
- Cannot create new Microsoft Team using PowerShell, even as Admin - Teams
- Fix: TypeError: set object is not subscriptable - Python