Hi there,
I've just migrated to Debian from the Kurumin distribution, where when I wanted to run a shell script, I ran
./script.sh
from the konsole.
Now, when I try to do this, i receive:
bash: ./script.sh: /bin/sh: bad interpreter: Permission Denied
My /bin/sh is a link to bash ( /bin/sh -> bash ), and I've also tried to change it to /bin/bash ( /bin/sh -> /bin/bash ), but the result is the same, as it's too when I use the
./script.sh
command as root.
I can use
sh script.sh
normally, but if somebody could tell me what's happening, I'd be very happy.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
A ./ problem
-
- Debian Developer, Site Admin
- Posts: 483
- Joined: 2004-04-06 18:19
- Location: Utrecht, NL
- Contact:
What does ls -l /bin/sh /bin/bash ./script.sh give? And cat /proc/mounts ?
And shebang is shorter way to say 'hashbang', which is 'haSH' 'bang', or the names of the characters '#' and '!'. See http://en.wikipedia.org/wiki/Shebang for more information.
And shebang is shorter way to say 'hashbang', which is 'haSH' 'bang', or the names of the characters '#' and '!'. See http://en.wikipedia.org/wiki/Shebang for more information.
Gotta love Wikipedia! Thanks for the link - I feel better as a geek now.
Maybe it's useful I mention again that even as the root user I still get the same error. For the outputs:
$ls -l /bin/sh /bin/bash ./script.sh:
-rwxrwxr-x 1 root alex 649556 2005-10-13 14:58 /bin/bash
lrwxrwxrwx 1 root root 4 2005-12-14 16:25 /bin/sh -> bash
-rwxr-xr-x 1 alex alex 645 2005-12-15 14:10 ./clean.sh
$cat /proc/mounts:
rootfs / rootfs rw 0 0
/dev2/root2 / reiserfs rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
/dev/sda6 /home xfs rw 0 0
/dev/sda2 /mnt/sda2 xfs rw,nosuid,nodev,noexec 0 0
usbfs /proc/bus/usb usbfs rw 0 0
Maybe it's useful I mention again that even as the root user I still get the same error. For the outputs:
$ls -l /bin/sh /bin/bash ./script.sh:
-rwxrwxr-x 1 root alex 649556 2005-10-13 14:58 /bin/bash
lrwxrwxrwx 1 root root 4 2005-12-14 16:25 /bin/sh -> bash
-rwxr-xr-x 1 alex alex 645 2005-12-15 14:10 ./clean.sh
$cat /proc/mounts:
rootfs / rootfs rw 0 0
/dev2/root2 / reiserfs rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
/dev/sda6 /home xfs rw 0 0
/dev/sda2 /mnt/sda2 xfs rw,nosuid,nodev,noexec 0 0
usbfs /proc/bus/usb usbfs rw 0 0
Who is alex?tukkek wrote: -rwxrwxr-x 1 root alex 649556 2005-10-13 14:58 /bin/bash
Why does he own bash?
# chown root:root /bin/bash
# chmod 755 /bin/bash
Debian Sys Admin
http://www.tldp.org/LDP/sag/html/index.html
http://www.tldp.org/LDP/sag/html/index.html