linux - Perl script in cgi-bin not executing shell script with arguments -


My Perl script is present in CGI-bin / relation: There is a problem in this snippet of code: < Pre> system ("./ upd_test.sh $ res_file $ label> log / upload log2 & amp; 1 & amp; - & gt; system does not work (" ./ upd_test .sh "); - & gt; works fine

I do not understand why this is happening, Apache server is used.

File permissions for Perl script are

  -rwxr-xr-x 1 root Apache1935 Oct File permissions for Shell Script   .sh   

If I can call Shell Script without arguments, then why is this issue when I call with arguments? The script is not said at all. The script has added a print that writes in the / tmp space whether it is executed or not.

I just found out that if I remove the redirect, then it works fine, then the system works fine (". / Upd_test.sh $ res_file $ label"), but I redirect the logs I want to do because it is very important for my work.

The current working directory is not your CGI script, so its use / will not work.

Try using FindBin () to get the directory or just the full path to the updcode_sht script.

But ... the system () is running from CGI scripts (hence, actually from web page) is dangerous.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -