can't run shell scripts

everytime i run a shell script (.sh) using “konsole”,it says “bad interpreter: permission denied”.

why is this happening?

Show us the output of the command “mount” and also give us the path where your shell script lives.

output of “mount” :

/dev/sda6 on / type ext3 (rw,acl,user_xattr)
/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /media/C type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda3 on /media/D type fuseblk (rw,noexec,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda5 on /media/MyStuff type ext3 (rw,noexec,nosuid,nodev,acl)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/proc on /var/lib/ntp/proc type proc (ro)

my shell script is in /dev/sda5

remove the noexec option from the /dev/sda5 line in /etc/fstab

That noexec was probably implied by the option user. Add exec after it to override.

there’s no “noexec” in the “fstab” file,i searched the document,nothing was found

and can somebody tell me where exactly should i put “exec”?

thanks in advance :slight_smile:

if so, then place exec somewhere in the options list of /dev/sda5… eg

/dev/sda5 /media/MyStuff ext3 rw,**exec**,acl

did this,saved the file,and i’m still having the same problem :\

you have to remount the partition after this

thanks a lot :slight_smile:

it worked,finally :smiley: