------------------------------------------------
On Thu, 6 Feb 2003 13:59:51 +0800, "Glynn S. Condez" <[EMAIL PROTECTED]> 
wrote:

> Hi all,
> 
> I have a question. From a web form, i pass the info to a cgi script.
> 
> i have this variable on the script:
> 
> $username = param('username');
> $lastname = param('lastname');
> 
> my question is, how can i use that two variable to another script 
> open by this command:
> 
> system('sudo', '-u', 'www', '/path/to/anotherscript.pl');
> 

Assuming you have worked out the details with sudo ahead of time (aka not having to 
enter a password, etc.), then:

system('sudo','-u','www',"/path/to/anotherscript.pl $username $lastname");

Should work, and 'anotherscript.pl' will have to expect the arguments in ARGV[0,1].  

If anotherscript.pl is and *must* be a cgi script, then you really have two options, 
develop it in such a way that it expects parameters in ARGV, which I believe CGI 
module will handle, or you can call a third party provider, like lynx, curl, etc. to 
call the script over HTTP but this gets harry and would seemingly lose your sudo 
privileges.....

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to