Running a C Script - Redhat

This is a discussion on Running a C Script - Redhat ; Hi- 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....

+ Reply to Thread
Results 1 to 3 of 3

Thread: Running a C Script

  1. Running a C Script

    Hi-

    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.


  2. Re: Running a C Script

    On 2007-10-29, Karthik 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.

    --
    Riemer Palstra
    riemer@palstra.com

  3. Re: Running a C Script

    Riemer Palstra wrote:
    > On 2007-10-29, Karthik 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

+ Reply to Thread