I create a lot of custom shell scripts. To make things easier for myself, I created a script for... creating a new bash shell script.

#!/usr/bin/bash

# Creates a bash shell script file, applies execute permission,
# and opens the file in vim.

SCRIPT_NAME=$(basename "$0")
USAGE="usage: $SCRIPT_NAME FILENAME"

if [[ $# -eq 1 ]]; then
        filename="$1"
        if [[ -f $filename ]]; then
                echo "file with name $filename already exists"
                exit 1
        else
                echo "#!/usr/bin/bash" > "$filename"
                chmod u+x "$filename"
                vim "$filename"
        fi
else
        echo "$USAGE"
fi