Thank you Bill,

the following works fine:


$command = "cmd /c " . $config{mysqldump_path} . $config{mysqldump_command}
. " --user " . $config{user}
             . " --result-file=" . $config{temp_dir} .  $output_file
             . " --password=" . $config{password} . " -c --opt -v
--add-drop-table " . $dbase;

open( DUMP , $command . " 2>&1 |") or die "Can't execute $command:$!\n";
    while( <DUMP> ){
    $dump .= $_;
    }
close(DUMP);

> -----Urspr�ngliche Nachricht-----
> Von:  $Bill Luebkert [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Mittwoch, 11. September 2002 20:59
> An:   Teifke Sascha ZFF FW-EI
> Cc:   [EMAIL PROTECTED]
> Betreff:      Re: Problem fetching Process-Output
> 
> Teifke Sascha ZFF FW-EI wrote:
> > Hello List-Members,
> > 
> > I want to run the Mysqldump Utitlity and send the Output from this
> commend 
> > to my mail account.
> > 
> > I've tried to different methods of fetching the output
> > 
> > #1
> > open(DUMP,"$command|") or die "Can't execute $command:$!\n";
> >     while( defined($_=<DUMP> )){
> >     $_ .= $dump;
> >     }
> > close(DUMP);
> > 
> > #2
> >     @dump = `$command`;
> > 
> > but none of them returns the desired output.
> > The output is displayed on the command line.
> > 
> > How can I fetch it?
> 
> Either the command is outputting direct to the console (bypassing STDOUT)
> or it's writing to STDERR; which you can redirect if you are using cmd.exe
> (not command.com) shell using 2>&1 syntax before |.  Or you could try
> redirecting STDERR to STDOUT in your script before the pipe.
> 
> -- 
>    ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
>   (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
>    / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
> -/-' /___/_<_</_</_     Castle of Medieval Myth & Magic
> http://www.todbe.com/
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to