How do I execute a bash script in Terminal?

Ballon picture Ballon · Feb 1, 2010 · Viewed 395.4k times · Source

I have a bash script like:

#!/bin/bash

echo Hello world!

How do I execute this in Terminal?

Answer

Yet another way to execute it (this time without setting execute permissions):

bash /path/to/scriptname