jdh has asked for the wisdom of the Perl Monks concerning the following question:
$cmd = "htpasswd -b myusers user3 pass"; print <<EOF Content-type: text/html <pre> Executing '$cmd' EOF ; # split the args into a list of strings @args = split(/\s+/, $cmd); # fork a new process off (child process gets 0 from this) if( not ($kid = fork()) ) # are we the kid process? { # if so, do what we want to do exec { $args[0] } @args; # exit cleanly exit(0); } # wait for the child to exit waitpid($kid,0); # print something back print "\n\nAnd now we returned back\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Executing htpasswd from within web cgi
by agentv (Friar) on Sep 18, 2002 at 21:15 UTC | |
by Wally Hartshorn (Hermit) on Sep 18, 2002 at 21:45 UTC | |
|
Re: Executing htpasswd from within web cgi
by Zaxo (Archbishop) on Sep 18, 2002 at 21:17 UTC |