[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: Input via pipe?



On Fri, 08 Dec 2006 16:56:28 +0100, Søren wrote:

> locate shssubs.c | showfdate

> Den viser bare kun den første fil locate finder og så stopper det
> hele. Er der en eller anden speciel besværgelse jeg skal afslutte
> showfdate med før den kører videre?

Al uddata fra locate bliver smidt i hovedet på showfdate.

Det lyder som om du forventer at din shell splitter locate's uddata op
og kalder showfdate på hver enkeltdel. Det gør den ikke.

Du kan løse det med xargs -l:

 $ locate /usr/include/asm/ppc
 /usr/include/asm/ppc-pci.h
 /usr/include/asm/ppc_asm.h
 $ locate /usr/include/asm/ppc | echo "HEP"
 HEP
 $ locate /usr/include/asm/ppc | xargs -l echo "HEP"
 HEP /usr/include/asm/ppc-pci.h
 HEP /usr/include/asm/ppc_asm.h
 $ 

Eller ændre showfdate så den selv splitter stdin op.


  Mvh.

-- 
 "Jeg har snart gennemlæst det meste af Internettet for       Adam Sjøgren
  at finde en løsning - men uden resultat..."            sslug@sslug


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-01-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *