Installing matlab on Centos5.
command I typed:
/media/MATHWORKS_R2009A/install &
Error message I received: [1] 10759 [root@taro matlab]# bash: /media/MATHWORKS_R2009A/install: /bin/sh: bad interpreter: Permission denied
Google found no hits with this precise error message, but several similar hits when I leave out the matlab path.
Solution:
mount -o remount -o exec /dev/scd0
(scd0 is the drive where the DVD is inserted.)
Hope this helps someone with the same problem.
Dave
Dave wrote:
Installing matlab on Centos5.
command I typed:
/media/MATHWORKS_R2009A/install &
Error message I received: [1] 10759 [root@taro matlab]# bash: /media/MATHWORKS_R2009A/install: /bin/sh: bad interpreter: Permission denied
Google found no hits with this precise error message, but several similar hits when I leave out the matlab path.
Solution:
mount -o remount -o exec /dev/scd0
(scd0 is the drive where the DVD is inserted.)
Hope this helps someone with the same problem.
You could have probably run the script using:
sh /media/MATHWORKS_R2009A/install
James Pearson
On Mon, Jul 27, 2009 at 3:20 AM, James Pearson james-p@moving-picture.comwrote:
Dave wrote:
command I typed: /media/MATHWORKS_R2009A/install &
Error message I received: [1] 10759 [root@taro matlab]# bash: /media/MATHWORKS_R2009A/install: /bin/sh: bad interpreter: Permission denied
Solution:
mount -o remount -o exec /dev/scd0
(scd0 is the drive where the DVD is inserted.)
Hope this helps someone with the same problem.
You could have probably run the script using:
sh /media/MATHWORKS_R2009A/install
No, I had tried that before I figured out that the DVD had been mounted with the noexec option. Noexec must be the default. No script located on the DVD can be executed by any shell so long as that option is in effect, AIUI. Dave
On Mon, 2009-07-27 at 23:15 -1000, Dave wrote:
On Mon, Jul 27, 2009 at 3:20 AM, James Pearson james-p@moving-picture.com wrote: <snip>
You could have probably run the script using: sh /media/MATHWORKS_R2009A/install
No, I had tried that before I figured out that the DVD had been mounted with the noexec option. Noexec must be the default. No script located on the DVD can be executed by any shell so long as that option is in effect, AIUI.
In bash, you could probably stil run it with the "source" or "," command, e.g.
. <the path to the script> source <the path to the script>
Dave
<snip sig stuff>
On Tue, Jul 28, 2009 at 1:04 AM, William L. Maltby CentOS4Bill@triad.rr.com wrote:
In bash, you could probably stil run it with the "source" or "," command, e.g.
. <the path to the script> source <the path to the script>
Nope, in desperation I tried those also, to no avail. My problem was that the disk was mounted noexec, and the OS refuses to run scripts that are located on partitions mounted noexec. From my history file:
334 . /media/MATHWORKS_R2009A/install
In fairness to previous responder James, I am not 100% sure he is wrong, since the final form of the command I ran was indeed
366 sh /media/MATHWORKS_R2009A/install &
But I am pretty sure I had tried that form previously, and failed until I invoked:
365 mount -o remount -o exec /dev/scd0
I am going by memory on that, because I was swapping shells in a way that makes my history file sort of spotty. So it is just possible he is right. So if someone finds themselves with a script on a DVD that spouts this error message, they should try both the fixes and see which one works. Or both?
Dave
Hi,
On Tue, Jul 28, 2009 at 14:52, Davetdbtdb+centos@gmail.com wrote:
On Tue, Jul 28, 2009 at 1:04 AM, William L. Maltby CentOS4Bill@triad.rr.com wrote:
In bash, you could probably stil run it with the "source" or "," command, e.g.
. <the path to the script> source <the path to the script>
Nope, in desperation I tried those also, to no avail. My problem was that the disk was mounted noexec, and the OS refuses to run scripts that are located on partitions mounted noexec. From my history file:
Running the script with "sh /media/dvd/install" or ". /media/dvd/install" will work as long as the script does not invoke any other scripts (without "sh" or ".") or binaries in the same DVD, at that point it will fail due to the "noexec" mount option. This is probably what happened to you, and you interpreted that as the script not being able to run, while in fact it was running, only the binary it was calling was unable to run.
I agree with Dave that the general solution to this problem (running software or installers from media) is to remount it with the "exec" option.
HTH, Filipe
On Sat, Jul 25, 2009 at 2:32 AM, Davetdbtdb+centos@gmail.com wrote:
Installing matlab on Centos5. [root@taro matlab]# bash: /media/MATHWORKS_R2009A/install: /bin/sh: bad interpreter: Permission denied
Sometimes this can happen if the file has Windows-style EOLs and the interpreter /bin/sh is translated as /bin/sh^M Indeed, on a Centos 5 here, the sh is in /bin/sh so the script probably should have worked.
Check if that is the case. If so, running dos2unix against the shell script might solve the problem.
On Mon, Jul 27, 2009 at 4:01 PM, Hakan Koseogluhakan@koseoglu.org wrote:
On Sat, Jul 25, 2009 at 2:32 AM, Davetdbtdb+centos@gmail.com wrote:
Installing matlab on Centos5. [root@taro matlab]# bash: /media/MATHWORKS_R2009A/install: /bin/sh: bad interpreter: Permission denied
Sometimes this can happen if the file has Windows-style EOLs and the interpreter /bin/sh is translated as /bin/sh^M Indeed, on a Centos 5 here, the sh is in /bin/sh so the script probably should have worked.
Check if that is the case. If so, running dos2unix against the shell script might solve the problem.
Please ignore my advice here, it's irrelevant and I should have read the message properly the first time!