There is a syntax error in your shell script. The first line that you show has a space character in it that is unexpected.
Instead of:
#! /bin/bash -ex
you want
#!/bin/bash -ex
There is a syntax error in your shell script. The first line that you show has a space character in it that is unexpected.
Instead of:
#! /bin/bash -ex
you want
#!/bin/bash -ex