Got it,when i create/edit the script on WinSCP,it doesnt work,when i create it on Putty it works, is that what you mean with ^M ? I think WinSCP cannot transfer .sh by default, i thin i have too take a look at the settings.
Unix uses a single character (^J - linefeed) to represent a new line. Windows uses two characters (^M + ^J - carriage return + linefeed (CRLF)). When transferring a file from Windows to Unix, that was saved in Windows, the ^M (like a snotty hanky) - comes with it. As a rule, Unix admins find this to be mildly irritating.
Thank you for explaining it.I have to take a look at the upload rules of winscp,normally it converts the files while transfering,but since 4-5 months it doesnt,dont know why.
Thank you for helping me ! This problem is really irritating and frustrating