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

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to