pipe output san grep search pattern
    Antonios-Kornilios Kourtis 
    el99027 at mail.ntua.gr
       
    Wed Sep 10 03:22:06 EEST 2003
    
    
  
On Tue, Sep 09, 2003 at 05:28:35PM -0400, Alexandros Papadopoulos wrote:
> Έστω πως έχω δυο-τρία pipes του στυλ:
> 
> grep SCS roster | cut -d , -f 2 | sort | uniq
> 
> ...που έτσι όπως είναι, μου δίνουν μια λίστα με tokens:
> 
> Chen
> Cohen
> Jagtap
> Kirigin
> Tong
> Wong
> 
> Το κάθε ένα από αυτά τα tokens υπάρχει μέσα σε ένα άλλο text file (έστω 
> addresses), με records της γενικής μορφής:
> 
> token, blah, blah, xx, number, blah
> 
> Θέλω να δω τη κάθε γραμμή του addresses που έχει κάποιο από τα tokens 
> που μου έδωσε το grep. Πώς μπορώ να "ταΐσω" τα αποτελέσματα του πρώτου 
> chain από greps σε ένα νέο grep σαν search patterns;
> 
> Δοκίμασα με xargs αλλά θεωρούσε ότι τα tokens ήταν search targets, και 
> όχι patterns. (οπότε και έφαγα πολλά "file not found")
> 
> Ευχαριστώ
> 
> -Α 
> -- 
> http://andrew.cmu.edu/~apapadop/pub_key.asc
> 3DAD 8435 DB52 F17B 640F  D78C 8260 0CC1 0B75 8265
Mporeis na dokimaseis kati san:
grep blah blah > /tmp/lala
grep -f /tmp/lala other_files
h
egrep `grep blah blah | perl -0 -pe 'chop; s/\n/|/g'` other_files
-- 
Kourtis Kornilios
"The worst is yet to come"
    
    
More information about the Linux-greek-users
mailing list