BASH - Hello World

Programmers often learn new languages via learning the hello world program. It’s a simple program that prints the string “Hello World” to the standard output.

Use an editor like vim or nano to create the file hello-world.sh and copy the below lines into it.

#!/bin/bash
echo "Hello World"

Save and quit the file.

You need to make this file executable using the below command.

chmod a+x hello-world.sh

You can run this using any of the below two commands.

bash hello-world.sh
./hello-world.sh

It will print out the string passed to echo inside the script.