Linux – How to run a .sh file in Red Hat

command-line-interfacelinuxredhatshell

When I tried to run my .sh file in Redhat using ./test.sh

I am getting a error like

[test@tester unix_scripts]$ ./test.sh
: No such file or directory
[test@tester unix_scripts]$ 

I have also set the permission of the file with chmod 777 test.sh

still the same error

Can anybody help me?

Best Answer

Actually the issue was the script that i used was created in dos, so i converted my script to unix by using dos2unix command. Thanks to all for your valuable help.