problems running bash scripts...

Gustavo Rahal listas at grahal.net
Sat Dec 20 21:24:24 UTC 2003


Tom Mitchell wrote:

>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
>  
>

Thanks for the reply Mitchell. After trying some more things I found out 
that the problems is that if I run scripts that are on /mnt/dados/ which 
is a mounted fat32 partition this problem occurs. On the root partition 
everything goes fine. But why doesn't it work on fat32 (or maybe with 
any mounted partitions)?

Thanks
Gustavo





More information about the fedora-list mailing list