Re: Running a C Script



Riemer Palstra wrote:
On 2007-10-29, Karthik <Srikumar.karthiknarayanan@xxxxxxxxx> wrote:

I use a Redhat Enterprise 4.0 OS, I am running a Script that is
written on C Code, When i run the script it gives me a error that
command not found.

[root@ssh-mach3 /root]# ./Script_Red_Hat_Linux_20071023.sh
./Script_Red_Hat_Linux_20071023.sh: Command not found.


Well, C code is usually compiled after which the created binary is run,
and in this case, if you should believe the filename, this looks more
like a bash/sh/csh script to me.

Try cat'ing or less'ing the file and see if you get any readable output.
It could be that the first line contains an invalid path to a script
interpreter, which needs to be corrected.

Dear Karthik and Riemer,


My first guess would be lack of an execute bit.

Karthik: what is the output of:

ls -l ./Script_Red_Hat_Linux_20071023.sh


Riemer: If it would be an intepretor problem I would expect an error like this:

../Script_Red_Hat_Linux_20071023.sh line 1: /path/command not found


Kind regards,


Jan Gerrit Kootstra
.