LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   /bin/sh: bad interpreter: Permission denied (https://www.linuxquestions.org/questions/slackware-14/bin-sh-bad-interpreter-permission-denied-392740/)

njbrain 12-14-2005 08:55 AM

/bin/sh: bad interpreter: Permission denied
 
I am trying to install wine, but I just get this error.

tools/wineinstall: ./configure: /bin/sh: bad interpreter: Permission denied

Thanks in advance for your help.

320mb 12-14-2005 09:09 AM

this error usually pops up if one does not have write access to a certain directory.......

njbrain 12-14-2005 11:33 AM

I have permission to write, but it still won't work.

urka58 12-14-2005 04:18 PM

If the script has executing permissions for the user and group (if not already logged as root), may be the file system hosting such file has been mounted with the "noexec" option. Is it possible?
Ciao

slacksource 12-14-2005 04:22 PM

are you using the bash shell. It should then read /bin/bash not /bin/sh, If I am not mistaken thats a different shell and thats the reason you get the bad interpretor error.

when writing scirpts dont you start by stating the interpreter

#/bin/bash

??? just a thought

philippeP 12-14-2005 05:25 PM

Might not be the same, but I had such an error when trying to execute a file on an external filesystem. So same reply as above, make sure there is no "noexec" option preventing file execution.

My added comment: look out for other options which imply "noexec" (e.g. "user", or the order of the options)

See man mount if this is the issue.

Woodsman 12-15-2005 10:34 AM

Quote:

are you using the bash shell. It should then read /bin/bash not /bin/sh, If I am not mistaken thats a different shell and thats the reason you get the bad interpretor error.
In Slack the two are soft linked and essentially are one and the same. The difference between the generic shell and the bash shell is in the script headers. If the script uses #!/bin/sh then bash limits itself to running as a generic shell. But since /bin/sh is soft linked to /bin/bash, bash still runs the script. However, if the script header is #!/bin/bash then one is able to use the additional features available in bash not available in the generic shell.

Quote:

. . ./bin/sh: bad interpreter: Permission denied. . .
I see this often when I copy files from Windows to my Slack box and the original file is in DOS text format. This sometimes happens to me when I snag a code snippet or script while surfing the net in Windows and I save the file locally. The default saved format is then DOS and not 'nix. Possibly check your config files and verify they are not using the DOS End-of-Line (EOL) marker.

Another quirk is trying to run the scripts from a non-'nix file system, such as FAT32 (as mentioned just above by philippeP. I saw this happen on my multi-boot box when in Windows I saved downloaded scripts to my shared FAT32 partition. When I rebooted into Slack I then could not run the scripts from that partition. Not sure why because my FAT32 is read-write-exec. I haven't tried that in a long while, however, so perhaps my problem was actually the DOS EOL format and not the file system. But just another thought.

Widgeteye 12-15-2005 07:46 PM

Quote:

Originally Posted by njbrain
I am trying to install wine, but I just get this error.

tools/wineinstall: ./configure: /bin/sh: bad interpreter: Permission denied

Thanks in advance for your help.



#!/bin/sh

MUST be at the very top of the page and it's best to have a carriage return after it.
There CANNOT be a empty line ABOVE #!/bin/sh or you will get this error.

njbrain 12-21-2005 09:25 PM

Hi all,
I changed the line in my fstab to this, and now all works fine.
/dev/hda2 /home ext3 defaults 1 2

spoonyfork 04-26-2010 08:13 AM

This happened to me when I FTP'd up a #!/bin/sh shell script from a Windows host. The fix was to run dos2unix against the shell script.

chess 04-26-2010 11:46 AM

Quote:

Originally Posted by spoonyfork (Post 3948053)
This happened to me when I FTP'd up a #!/bin/sh shell script from a Windows host. The fix was to run dos2unix against the shell script.

Yes, this is the most common reason for the problem, I think. Lots of ^M characters added for Windows/DOS carriage return that breaks the script.

Edit: wow, this is a thread from 2005 and I did not even realize it.


All times are GMT -5. The time now is 10:38 PM.