[so] [Tema1][Linux] cut in pipe

Emilia Pana emilia.pana at gmail.com
Fri Apr 9 11:33:16 EEST 2010


A mai avut cineva probleme cu comanda "cut" intr-o inlantuire de pipe-uri,
in sensul ca daca nu este ultima comanda nu produce output?

Daca am o inlanturie de pipe-uri, oricate, fara comanda "cut" prin ea, merge
f ok.

Daca am o inlantuire de pipe-uri in care comanda "cut" e ultima, produce
outputul corect (de ex ls | tr -s ' ' | cut -d ' ' -f 2).

Daca am o inlantuire in care "cut" mai e urmat de o comanda, comanda
urmatoare nu primeste input. De ex:
 ls | cut -d ' ' -f 2 | wc intoarce 0 0 0
 ls | cut -d ' ' -f 2 | sort nu afiseaza nimic.
Nu conteaza a cata comanda in lant e "cut", atata timp cat nu e ultima. Iar
celelalte comenzi merg toate ok.

Apreciez orice eventuala sugestie.
Emilia Pana.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/lurker/list/so.html/attachments/20100409/47edcdbf/attachment.htm>


More information about the so mailing list