problems running bash scripts...

Tom Mitchell mitch48 at sbcglobal.net
Sat Dec 20 20:40:59 UTC 2003


On Sat, 20 Dec 2003, Gustavo Rahal wrote:

> From: Gustavo Rahal <listas at grahal.net>
> To: fedora-list at redhat.com
> Subject: problems running bash scripts...
> Date: Sat, 20 Dec 2003 18:39:52 +0000
> Reply-To: fedora-list at redhat.com
> 
> Hi
> 
> When trying to run any bash script I get the following message: "bash: 
> ./xxxx: /bin/bash: bad interpreter: Permission denied".. Even as root I 
> get the same message... any idea?

Someone has messed with the permissions of your bash binary
or you are not involing the bash you expect.

Check .....
 $ which bash
 /bin/bash
 $ ls -l `which bash`
 -rwxr-xr-x    1 root     root       626028 Apr  9  2003 /bin/bash

 $ cat /tmp/b1.sh
 #! /bin/bash
 echo Hello

 $ /tmp/b1.sh
 bash: /tmp/b1.sh: Permission denied
 $ chmod +x /tmp/b1.sh
 $ /tmp/b1.sh
 Hello

 $ cp `which bash` /tmp/bshell

 $ cat /tmp/b2.sh
 #! /tmp/bshell
 echo Hello

 $ /tmp/b2.sh
 Hello

 $ chmod -x /tmp/bshell
 $ /tmp/b2.sh
 /bin/bash: /tmp/b1.sh: /tmp/bshell: bad interpreter: Permission denied

My guess is that the path to the interpreter in the first line  depends on PATH
with a dot in it or something. i.e.:
	#! /bin/bash
 .vs. 
	#! bash
and `which bash` for you finds some text file perhaps bashing a political person.
This by the way is the same reason why you should never write a program called 'test'.

Good luck,
TomM

-- 
	T o m  M i t c h e l l
	mitch48 -a*t- yahoo-dot-com





More information about the fedora-list mailing list