Thanks all...

I was printing in normal fashion. I should have used something lik:

print STDERR "stderr\n";

as suggested by all.

Cheers,
Parag



On Sat, May 1, 2010 at 1:55 AM, Philip Potter <philip.g.pot...@gmail.com>wrote:

> On 30 April 2010 18:45, Parag Kalra <paragka...@gmail.com> wrote:
> > Hey All,
> >
> > I am trying to execute a Perl via shell script. I want to redirect output
> of
> > Perl script to one file and error occured (if any) to other file.
> >
> > This is the snippet from my shell script:
> >
> > perl output_error.pl 1>> Report.log 2>>Error.log
> >
>
> What you have written works for me. I think your error is somewhere else.
>
> $ cat foo.pl
> #!perl
>
> print "stdout\n";
> print STDERR "stderr\n";
>
> $ perl foo.pl 1>> out 2>> err
> $ cat out
> stdout
> $ cat err
> stderr
>
> Note that >> appends to the end of a file, while > replaces the file.
>
> Phil
>

Reply via email to