when run a .sh file copy from Windows machine, run in terminate in MacOS, the output said:
: command not found8:
when an empty row in .sh file. Remove all the empty rows and it said :
/bin/sh^M: bad interpreter: No such file or directory
Use vi command to check the file format: see the format is dos at bottom line of the terminate.

Run :set ff=unix and then save the file resolved the issue.