If you are only interested in the first occurence of a pattern, you can use something like sed -n '/<pattern>/ { p q }' file Harald Schaefer Siemens Corp. - RTL Bus. Phone (609) 734 3389 Home Phone (609) 275 1356 uucp: ...!princeton!gypsy!hasch hasch at gypsy.uucp ARPA: hasch at siemems.com hasch%siemens at princeton.EDU