Afficher un message
Vieux 15/03/2008, 06h27   #3
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Redirection and additional file descriptors

In article
<6d71ad7a-e06b-48fc-8804-7ffbff43f58d@h11g2000prf.googlegroups.com>,
Teo <matteo.corti@gmail.com> wrote:

> 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.


Since this isn't a common behavior, there aren't really any "similar
cases". Any program that does this is ideosyncratic, and the solution
depends on how that program is designed.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
 
Page generated in 0,04934 seconds with 9 queries