From: Jamie C. <jca...@we...> - 2005-05-24 04:48:31
|
You must be seeing the Webmin process that then starts the bldora9ddl process. Try searching for processes whose parent PID is the returned pid. - Jamie On Tue, 2005-05-24 at 14:35, Tan Rezaei wrote: > I did some more debugging and now am trying the following code: > > &foreign_require("proc", "proc-lib.pl"); > ($fh, $pid) = &proc::pty_process_exec("bldora9ddl -UR test gl gltransrel"); > print "$fh $pid"; > @list=&proc::list_processes($pid); > $cmd=@list[0]->{args}; > print "<br>$cmd"; > > that last print statement gives me: > > "perl /usr/local/webmin/miniserv.pl /etc/webmin/miniserv.conf" > > which is weird cause I am expecting to see "bldora9ddl -UR test gl > gltransrel". Any clues what I am doing wrong here? > Its funny cause when I try the passwd example the print statment gives me > the correct command. > > Thanks > > Tan > > ----Original Message Follows---- > From: Jamie Cameron <jca...@we...> > Reply-To: web...@li... > To: web...@li... > Subject: Re: [webmin-devel] pty_process_exec > Date: 24 May 2005 13:39:50 +1000 > > On Tue, 2005-05-24 at 12:27, Tan Rezaei wrote: > > I am trying to get this to work but I get a "-1" as my $rv when I run it. > I > > am not sure what I am doing wrong. > > > > &foreign_require("proc", "proc-lib.pl"); > > ($fh, $pid) = &proc::pty_process_exec("$driver -UR $pdline $sys $tab"); > > while(1) { > > $rv = &wait_for($fh, "Are you sure you want to continue (Yy)\?"); > > print $rv; > > if ($rv == 0) { > > print "Saying Yes"; > > sysprint($fh, "y\n"); > > } > > else { > > last; > > } > > } > > close($fh); > > > > > > And my prompt looks like this when I run the command from the terminal: > > > > This option will also remove all of the data. > > Are you sure you want to continue (Yy)? > > > > I need to type in "y" here and hit enter here. > > > > I have also tried maney other patterns in place of "Are you sure you want > to > > continue (Yy)?" > > > > I even tried just "\?" or "\\?" nothing seems to work. > > > > Thanks for your help > > You could try changing the wait_for call to something like : > > $rv = &wait_for($fh, 'Are you sure you want to continue \(Yy\)\?'); > > Quoting the (, ) and ? characters is important, as the parameters to > wait_for are regular expressions. > > - Jamie |