Sunday 6 September 2015

shell script is not executing due to ^M at the end of each line in script file

This is due to unix conversion.we can see this type of ^M symbols when script file is copied from one host to other.

Run the below command

#dos2unix afile.sh afile.sh

after running the above command you will get file without ^M at the end.
Note: try to run this command using root user

Note : if you are getting ^M during execution time of script check provided environment details provided in script file are correct or not.

No comments:

Post a Comment