BASH stands for Bourne-Again SHell and is is a Unix shell and command language for most Linux distributions.
It’s relatively easy to start writing BASH scripts, so here’s a good starting point.
#!/bin/bash
echo "Hello World"
There’s a few elements to this script here, so we’ll break it down:
First, this – #! – is called a shebang, or sha-bang, or hash-pling plus a few other variations. This is a two-byte special marker that designates a file type, or in this case an executable shell script.
Immediately following the shebang is a path name – /bin/bash. This is the path to the program that interprets the commands in the script.
The echo command is used to display a line of text that is passed in as an argument in the terminal.
We’re keeping it simple here, but when you run this script in your terminal, this is what will happen:
chrisapp@server1:~/scripts$ sh helloworld.sh
Hello World