can't run shell scripts

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

why is this happening?


mhh91

mhh91’s Profile: http://forums.opensuse.org/member.php?userid=15746
View this thread: http://forums.opensuse.org/showthread.php?t=407436

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


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=407436

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


mhh91

mhh91’s Profile: http://forums.opensuse.org/member.php?userid=15746
View this thread: http://forums.opensuse.org/showthread.php?t=407436

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


‘Get h264enc’ (http://h264enc.sourceforge.net) - ‘Get xvidenc’
(http://xvidenc.sourceforge.net)
- ‘Get divxenc’
(http://divxenc.sourceforge.net)

microchip8’s Profile: http://forums.opensuse.org/member.php?userid=163
View this thread: http://forums.opensuse.org/showthread.php?t=407436

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


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=407436

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:


mhh91

mhh91’s Profile: http://forums.opensuse.org/member.php?userid=15746
View this thread: http://forums.opensuse.org/showthread.php?t=407436

mhh91;1942582 Wrote:
> 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

Code:

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


‘Get h264enc’ (http://h264enc.sourceforge.net) - ‘Get xvidenc’
(http://xvidenc.sourceforge.net)
- ‘Get divxenc’
(http://divxenc.sourceforge.net)

microchip8’s Profile: http://forums.opensuse.org/member.php?userid=163
View this thread: http://forums.opensuse.org/showthread.php?t=407436

microchip8;1942597 Wrote:
> if so, then place exec somewhere in the options list of /dev/sda5… eg
>
> >
Code:

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

> >

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


mhh91

mhh91’s Profile: http://forums.opensuse.org/member.php?userid=15746
View this thread: http://forums.opensuse.org/showthread.php?t=407436

you have to remount the partition after this


‘Get h264enc’ (http://h264enc.sourceforge.net) - ‘Get xvidenc’
(http://xvidenc.sourceforge.net)
- ‘Get divxenc’
(http://divxenc.sourceforge.net)

microchip8’s Profile: http://forums.opensuse.org/member.php?userid=163
View this thread: http://forums.opensuse.org/showthread.php?t=407436

thanks a lot :slight_smile:

it worked,finally :smiley:


mhh91

mhh91’s Profile: http://forums.opensuse.org/member.php?userid=15746
View this thread: http://forums.opensuse.org/showthread.php?t=407436