Facing error like this ? : bad interpreter: No such file or directory

Some time after uploading some .sh (script) files from Windows to Unix environment, when we tried to run teh scripts as show nbelow we may end up in facing some errors as below ...


bash-3.00# pwd
/kbabu/builds/build_tl1tsm
bash-3.00# ls
INSTALL OMNIbus-v7.2.1-solaris2-5.11.18.tar tl1tsm-5.3.2-sun.sh
OMNIbus-v7.2.1-solaris2-5.11.18.jar packages
bash-3.00# ./tl1tsm-5.3.2-sun.sh
: bad interpreter: No such file or directory
bash-3.00# sh tl1tsm-5.3.2-sun.sh
tl1tsm-5.3.2-sun.sh: ^M: not found
tl1tsm-5.3.2-sun.sh: ^M: not found
tl1tsm-5.3.2-sun.sh: ^M: not found
tl1tsm-5.3.2-sun.sh: ^M: not found
tl1tsm-5.3.2-sun.sh: {^M: not found

Installation aborted. Cleaning up, please wait...
bash-3.00#

So the solution for this kind of problems is .. as below

Its something to do with cr/lf characters when u ftp'd the binary

just execute the following command followed by the file name ..
perl -i -pe's/\r$//;'

Ex: perl -i -pe's/\r$//;'
and hit enter.

sol2 : perl -e '%s/^M//'
It will fix your problem



0 comments to "Facing error like this ? : bad interpreter: No such file or directory"

Post a comment

Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")

Popular Posts

Enter your email address:

Buffs ...

Tags


Powered by WidgetsForFree

Archives