in reply to Re: calling external programs via cgi perl script
in thread calling external programs via cgi perl script

the code looks like this
print `source command`; print system("source command");
i'm getting a value or -1 for the system my cgi page works fine without the command line. If I source the command file on my xterm window, it works fine

Replies are listed 'Best First'.
Re^3: calling external programs via cgi perl script
by Joost (Canon) on Mar 22, 2007 at 23:53 UTC
    Sourcing a shell script from system() will not do anything more useful than just running the script using system() - if it works at all (not sure, since source isn't a command but a shell built-in). Also, a return value of -1 from system() indicated a failure to execute the provided command.

    Anyway, that's still not enough information to help you fix the problem.

    Does the CGI script run as expected from the command line? What is the exact line of code you're using to run the script?And most importantly, what's in the error logs?

      My CGI script runs fine from the command line. Still shows nothing and value -1 from the system call. i just run ./myscript.cgi I don't see any error logs...
Re^3: calling external programs via cgi perl script
by echoangel911 (Sexton) on Mar 22, 2007 at 23:49 UTC
    inside the command file, there is a line that sources some environment paths and variables.