Hello wise monks,
I come here seeking wisdom as to why backticks (I know, only use them if I have to) are not playing nicely with my script when it is run through the web. If I run my script through a terminal, it works beautifully, but when I try to run it remotely from a web server it barely does anything.
So the reason I am using backticks is I am automating testing of my script, and I want to know what the result of each run of my script is (what STDERR and STDOUT is generated). As far as I know, backticks are the best way to go about this (correct me if I am wrong though).
This is the code I am using to test my script:
`dashboard.pl --source $_ 1>&2`;Yes, the path is relative. This is because both the scripts are in the same directory. I have also tried giving the absolute path (/u/alexandg/web/dashboard.pl) and it also was to no avail. The "--source $_" is the argument I use to pass in the test case. I am 100% sure this is not the issue.
The trouble is when I run this same command from the web server, nothing is reported back to the script. Granted I am not checking the return of the backticks, because I want them to ALWAYS continue no matter what happens. If the script I am testing crashes, thats OK, just report it and move onto the next test case.
All of these cases are stored inside of a while loop, and I am iterating over <$FILE> for test cases.
The questions I have are why doesn't this work from the web server, and how can I get it to function from both the command line and from the web?
Thank you!
In reply to CGI and Backticks by agronbach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |