Re: Redirection and additional file descriptors
Hi again,
On Mar 14, 4:29 pm, Teo <matteo.co...@gmail.com> wrote:
> i am using cpan2rpm to generate RPMS from CPAN perl modules. The
> script (cpan2rpm is a perl script) uses several non standard file
> descriptors for output (i.e., saves the descriptors, redirects some
> output to /dev/null, and restores them).
>
> Now I would like to parse the output of cpan2rpm but it seems that is
> neither on stdout nor in stderr:
>
> cpan2rpm Class::Accessor > /dev/null 1> /dev/null 2> /dev/null
>
> produces
>
> Generating spec file
> SPEC: /usr/src/redhat/SPECS/Class-Accessor.spec
> RPM: /usr/src/redhat/RPMS/noarch/perl-Class-
> Accessor-0.31-1.noarch.rpm
> SRPM: /usr/src/redhat/SRPMS/perl-Class-Accessor-0.31-1.src.rpm
>
> How can I store this output to a variable (or file)?
[...]
Nevemind looking at the sources I found out an option --keep-pipes :-)
But I would be glad to know how to handle similar cases.
Thanks anyway
Matteo
|