LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-14-2005, 08:55 AM   #1
njbrain
Member
 
Registered: Jan 2004
Location: Rhinelander, WI, U.S.
Distribution: Slackware
Posts: 416

Rep: Reputation: 30
/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.
 
Old 12-14-2005, 09:09 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
this error usually pops up if one does not have write access to a certain directory.......
 
Old 12-14-2005, 11:33 AM   #3
njbrain
Member
 
Registered: Jan 2004
Location: Rhinelander, WI, U.S.
Distribution: Slackware
Posts: 416

Original Poster
Rep: Reputation: 30
I have permission to write, but it still won't work.
 
Old 12-14-2005, 04:18 PM   #4
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
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
 
Old 12-14-2005, 04:22 PM   #5
slacksource
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Rep: Reputation: 0
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
 
Old 12-14-2005, 05:25 PM   #6
philippeP
LQ Newbie
 
Registered: Sep 2005
Location: Germany
Distribution: Debian sarge/etch
Posts: 18

Rep: Reputation: 0
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.
 
Old 12-15-2005, 10:34 AM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
Old 12-15-2005, 07:46 PM   #8
Widgeteye
Member
 
Registered: Mar 2005
Posts: 130

Rep: Reputation: 17
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.
 
Old 12-21-2005, 09:25 PM   #9
njbrain
Member
 
Registered: Jan 2004
Location: Rhinelander, WI, U.S.
Distribution: Slackware
Posts: 416

Original Poster
Rep: Reputation: 30
Hi all,
I changed the line in my fstab to this, and now all works fine.
/dev/hda2 /home ext3 defaults 1 2
 
Old 04-26-2010, 08:13 AM   #10
spoonyfork
LQ Newbie
 
Registered: Apr 2010
Distribution: SLES
Posts: 1

Rep: Reputation: 0
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.
 
Old 04-26-2010, 11:46 AM   #11
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware and OpenBSD
Posts: 740

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by spoonyfork View Post
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.

Last edited by chess; 04-26-2010 at 11:47 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/usr/bin/env: bad interpreter: Permission denied Master Fox Linux - Software 8 02-09-2012 08:25 AM
/bin/sh: bad interpreter: Permission denied itsaso Linux - Newbie 6 05-18-2005 10:00 AM
Selinux, ./INSTALL: /bin/sh: bad interpreter: Permission denied TomF Linux - Security 2 12-08-2004 11:36 AM
: bad interpreter: Permission denied LinuxRam Linux - Newbie 2 08-22-2004 09:33 PM
/bin/sh: bad interpreter: Permission denied linmix Linux - Software 12 08-16-2004 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration