AnatomyOf

Anatomy of a Bash file

example.sh
1#!/usr/bin/env bash
2
3# A minimal Bash script (it worked on my machine)
4greeting="Hello"
5
6greet() {
7 local name=$1
8 echo "$greeting, $name!"
9}
10
11if [[ -n "$name" ]]; then
12 greet "$name"
13else
14 greet "World"
15fi
16
17exit $?
Shell (Bash) is a command-line interpreter and scripting language used for task automation and system administration on Unix-like systems.