I tried this 
system("$cmd1 | tee -a $logFile") ;
but I get 
sh: syntax error at line 5: `|' unexpected

where line 5 is the line in which I declare the var for the output log

my $logFile ="<some dir>/automateLabelPush.log";

On Wed, 16 Mar 2005 10:59:31 -0800, Paul Ohashi <[EMAIL PROTECTED]> wrote:
> What if you piped your system command to tee, like:
> 
> system("$cmd1 | tee -a outfile.log") ;
> 
> 
> -----Original Message-----
> From: Nishi Prafull [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 16, 2005 10:55 AM
> To: beginners@perl.org
> Subject: log output
> 
> Hi:
> I am running a perl script as part of a cron job and I want to log the
> execution of the script(for sucess, failure).
> In my script, I make calls to external software on the machine to run
> certain tasks.
> How can I direct the output of these tasks to a local log on my
> machine during the execution of the script as part of the cron job.
> 
> #!/usr/local/bin/perl5.6 -w
> 
> use strict;
> my $label = "SOME_" ;
> my $emd = "dcat.emd";
> my $cmd1 = qq{ ade useview atview -exec 'ade label_product \\
>                -l $label -config_spec_file dcat.cs \\
>                -output_emd $emd -prod dc' -exec 'intg -t ADE:push \\
>                 -l $label --ADE_EMD $emd --ADE_New_Series 1'
>               };
> system($cmd1) ;
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to