Skip to content

Bash

With bash we can create scripts that automate tasks.

First we create a file withouth extension and add the following content:

#!/bin/bash

echo "Hello, World!"

Then we make the file executable:

chmod +x script

Finally we run the script:

./script

The output will be:

Hello, World!

If we want to make this executable from anywhere, we can move the file to a directory in the PATH:

sudo mv script /usr/local/bin
script