Article View: es.comp.os.linux.programacion
Article #11517Re: programacion shell
From: Jos� Luis P�rez Diez
Date: Fri, 16 Nov 2001 12:01
Date: Fri, 16 Nov 2001 12:01
29 lines
2078 bytes
2078 bytes
In article <9t2l16$ga3$1@noucreus-atm.cesca.es>, Llu�s Armengol Dulcet wrote:
> open (FH, "file.txt");
> while (<FH>) (� bien @file = <FH>; foreach(@file);)
>
> {
> `bl2seq -i $_ -j otro.fichero -o fichero.salida`
> }
>
> el programa bl2seq tarda mucho rato en procesar cada uno de los ficheros
> listados en file.txt de manera que se para el script de perl ...
Para manuales de la shell puedes mirar en /usr/doc/programa o
/usr/doc/packages/programa.
Si necesesitas realizarlos secuencialmente puedes usar system( asi te mantienes
en perl, el codigo sera mas portable) o exec si se puede usar el programa en
paralelo o incluso lo puedes enviar mediante un pipe a una nueva shell (no es
tan portable pero ha de funcionar)
una cosa como :
open (COMANDOS '|/bin/bash');
open (FH, "file.txt");
@file = <FH>;
foreach my $fichero (@file);)
{
print COMANDOS "bl2seq -i $fichero -j otro.fichero -o fichero.salida\n"
}
print COMANDOS "exit\n";
close COMANDOS;
Technical Details
Message-ID:
<VA.00000271.0ab07d6d@noemai.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!sfo2-feed1.news.digex.net!intermedia!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsfeed.bcn.ttd.net!news.bcn.ttd.net!not-for-mailReferences:
<9t2ht8$97a$1@noucreus-atm.cesca.es> <m3j2t9.tk1.ln@carlos.monchonet> <cgj2t9.tk1.ln@carlos.monchonet> <9t2l16$ga3$1@noucreus-atm.cesca.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,f05dae39fb240ab5 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-11-16 04:01:16 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!sfo2-feed1.news.digex.net!intermedia!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsfeed.bcn.ttd.net!news.bcn.ttd.net!not-for-mail From: Jos� Luis P�rez Diez <Jluis@noEmai.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: programacion shell Date: Fri, 16 Nov 2001 13:01:32 +0100 Organization: JPD Co Lines: 30 Message-ID: <VA.00000271.0ab07d6d@noemai.com> References: <9t2ht8$97a$1@noucreus-atm.cesca.es> <m3j2t9.tk1.ln@carlos.monchonet> <cgj2t9.tk1.ln@carlos.monchonet> <9t2l16$ga3$1@noucreus-atm.cesca.es> Reply-To: Jluis@noEmai.com NNTP-Posting-Host: gencat.es Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va