ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have one more question. I'm trying to setup a simple cgi script in perl that will scp some files when it's being called on via the web. For example, http://serverA/cgi-bin/scp.pl, will then run my perl script. The code is simple:
I'm a bit confused about that last post. The link that you posted seems to point to a holding URL that is for sale. That aside, are you saying that you have one script calling another script? Also, I'm confused about your reference to running a bash script and seeing output on your console. If you run a script that writes to standard output as a CGI, the standard output goes to the HTTP socket that is opened by the HTTP server. That's the whole essence of how CGI works. There are some differences between the contexts of running any script, bash, perl, whatever, as an ordinary user from the commandline, and as the user that the web server runs as in the CGI context. One difference is the permissions normally assigned to the cgi-bin directory. As a CGI, your script is trying to write to the cgi-bin directory, which the web server should not have write access to (a fundamental security issue).
Please clarify what you are seeing (or not seeing), in both the test and production situations.
Okay, re-examining your question, I think I see what you may be questioning. You are printing the first line of the HTTP header, but the rest of the HTML is missing. You should probably create a proper HTML page with the <html> <head></head> <body> </body> </html> components. Some confirmation message in the body would be good, too.
I assume you have arranged ssh keys to permit paswordless secure copies.