The syntax that works for you ("sh xyz") says "start a shell, and have that 
shell read this file, and follow the instructions in it". To do that, you must 
have read permission for the file. By contrast "./xyz" says "execute this file" 
and for that, you must have execute permission :) These two really are handled 
differently, in the first case, you'll get by without the "#!/bin/bash" at the 
first line of the file, in the second case, the kernel loads the file, then 
examines it to determine _how_ to execute it (parsing, as it does so, the 
#!/blah, which tells it that it has a script and what interpreter to invoke).

What seems really odd to me is that every other shell I've ever used 
(including, I thought bash in the past/on other Unixen) say "cannot execute" if 
they find the file you name as $0 on a command line doesn't have execute 
permission for you. So, this error is really bizzare in my book. But whatever, 
once you know, you can handle it, right?

Cheers,
Simon


-----Original Message-----
From: Paul Smith <[EMAIL PROTECTED]>
Sent: Dec 13, 2004 4:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [newbie] /bin/sh: bad interpreter

On Sun, 12 Dec 2004 20:42:47 -0700 (GMT-07:00), Simon Roberts
<[EMAIL PROTECTED]> wrote:
> Bad interpreter is the error bash gives when the script isn't executable.
> 
> Do
> 
>   chmod +x LinxuxInstaller.bin
> 
> and it'll probably be happy.
> 
> (Anyone know why it does this strange thing?)

Simon,

It is strange, as if I go to the directory where LinxuxInstaller.bin is and I do

sh ./LinuxInstaller.bin

LinxuxInstaller.bin runs!

Paul



____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to