[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: peculiar problem with bash
On Fri, 14 Jul 2000, M K Saravanan wrote:
> hi,
>
> I downloaded a jdk1.2.2 rc4 for linux. When i tried to run the
> corresponding shell scripts to install jdk, bash is simply telling: No
> such file or directory. But I checked the filename spelling, case, path
> etc.., 100 times. Everything is correct. but when i got the following
> error mess.
>
> #./jdk-debug-1.2.2-RC4-linux-i386-glibc-2.1.2.sh
> bash: ./jdk-debug-1.2.2-RC4-linux-i386-glibc-2.1.2.sh: No such file or
> directory
>
> It seems to be a very strange problem. How can the bash say there is no
> such file when that file exists? Even I gave the full path -- no
> solution. What can be the problem?
>
The problem is quite simple. There is an extra '\r' at the end of
the line. You can find it by using
od -c filename
If you see '\r' then you know the problem. I have had this
problem with some scripts. ( Happens when you use a Windows/Dos editor to
code your scripts )
For fixing it use
tr -d '\r' <filename >newfilename
and run the script using sh newfilename
-George Samuel
---
Visit our home page at: www.chennailug.org
Send e-mail to 'ilugc-request@xxxxxxxxxxxxxxxxxx' with 'unsubscribe'
in either the subject or the body to unsubscribe from this list.