LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   problem executing scripts (https://www.linuxquestions.org/questions/linux-general-1/problem-executing-scripts-670415/)

mierdatuti 09-17-2008 01:02 AM

[SOLVED] problem executing scripts
 
Hi,

I have red-hat 5. I mount the cdrom and I try to execute any script of the cd-rom and it's imposible, for instance:

[root@localhost pre_req]# ./check_req.sh
bash: ./check_req.sh: /bin/sh: bad interpreter: Permiso denegado

[root@localhost pre_req]# ls -ltr check_req.sh
-rwxr-xr-x 1 725 324 56751 jul 6 22:55 check_req.sh


I can't understand because if I mount the same cd-rom on suse I don't have any problema,

Could you help me?
thnaks a lot

jschiwal 09-17-2008 01:20 AM

Which distribution are you running? RH5? Is this the Enterprise version?

Anyway, try running the script as an argument to sh: for example; "sh /media/cdrom/check_req.sh"

The iso9660 filesystem may be mounted with the noexec option by your system.

mierdatuti 09-17-2008 02:19 AM

Quote:

Originally Posted by jschiwal (Post 3282748)
Which distribution are you running? RH5? Is this the Enterprise version?

Anyway, try running the script as an argument to sh: for example; "sh /media/cdrom/check_req.sh"

The iso9660 filesystem may be mounted with the noexec option by your system.


thanks.. if I execute source check_req.sh it works but if the script call other if fail again.

I have the version Enterpise....why do you ask me these?

Thanks a lot and sorry for my english!

Valery Reznic 09-18-2008 04:51 AM

Quote:

Originally Posted by mierdatuti (Post 3282794)
thanks.. if I execute source check_req.sh it works but if the script call other if fail again.

I have the version Enterpise....why do you ask me these?

Thanks a lot and sorry for my english!

The ofter reason for "bad interpreter" error message is '\r' in the scripts
(It usually got here when files edited on DOS/Windows and then copied to Unix)

I don't know why you able execute it on Suse - may be cdrom mounted with differnts options ? See 'man mount' - conv=auto may help

mierdatuti 09-19-2008 04:21 AM

Quote:

Originally Posted by Valery Reznic (Post 3284263)
The ofter reason for "bad interpreter" error message is '\r' in the scripts
(It usually got here when files edited on DOS/Windows and then copied to Unix)

I don't know why you able execute it on Suse - may be cdrom mounted with differnts options ? See 'man mount' - conv=auto may help

Thanks.

The problem was that red hat enterprise linux 5 mount the cdrom with option -noexec.

Many thanks!


All times are GMT -5. The time now is 03:06 AM.