Start the file with

#!/bin/bash
code here

need to make the file executable by

chmod +x FILENAME.sh

Checkout my WordPress installer script at https://github.com/ekka21/WordpressInstaller