Diff Fail

How DO you make diff only print out the lines that are common in more than one of two or more textfiles? I can’t figure it out. But I can help myself.

cat emails*.txt | sort | uniq -c | sort -n | while read num email ; do if [ $num -gt 1 ] ; then echo $email ; fi ; done

My name is Enno, and I have a bash problem. This is not my first time here at Bashers Anonymous.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s