Problem:
1. The script test.sh was zipped copied from one linux server to another and then unzipped
2. The script test.sh wwas given right permissions
3. Scripts were read and modified using vim editor on both servers
4. Both the servers ( to and from ) have the same version of linux and red-hat
>>dmesg
dmesg command gives system details and showed that linux versions were same
While test.sh execution , below error occured
Error
/bin/sh^M: bad interpreter: No such file or directory
Cause of Error: Still not sure how ^M char could be found.
However using dos2unix test.sh solved the problem
for all the scripts use >> dos2unix *.sh ( but 'dos2unix *' does not work ?? weird !! )
b.) another solution is open using vi and then :set fileformat=unix also solved the problem
Links:
http://pbxinaflash.com/forum/showthread.php?t=3738
http://www.gizmola.com/blog/archives/87-Linux-shell-scripting-bad-interpreter-No-such-file-or-directory.html
http://www.edaboard.com/thread219178.html
to get system related info like linux version or linux provider
ReplyDelete>> dmesg
to get system RAM
>> dmesg | grep RAM
Memory distribution usage
Delete>>df -k
Total memory of a file of folder
>>du -hs $filename