'bash shell script not executing in mac

I have a simple bash script test.sh

#!/bin/sh
# This is a comment
echo "Hi"

It does not execute anything when I try to run ./test.sh

$ ./test.sh 
$

It comes with empty output. The mac terminal is executing echo commands but not shell script. I am not sure what I am missing. Please suggest.



Solution 1:[1]

to execute command file , type sh test.sh

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mashhood Ur Rehman Bhatti