You may get an error when execute shell script in linux based system, 

# ./samplescript.sh

-bash: ./samplescript.sh: /bin/sh^M: bad interpreter: No such file or directory


You need to check the file using UNIX line ending or can use dos2unix command to change the file format. If you can not found the command install it.
 
# yum install dos2unix

# dos2unix samplescript.sh
dos2unix: converting file  samplescript.sh to UNIX format ...