The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-25-2007
kingdbag kingdbag is offline
Registered User
  
 

Join Date: Jun 2006
Location: Las Vegas, NV
Posts: 104
grep throws in dashes?

Hey guys,

I'm trying to grep for two things out of a file and I got that working but why is it randomly throwing "--" in the output? Is there a simple way to get rid of them? It only seems to do it when the line above what im looking for has numbers in it.

Code:
$ egrep -i -B 1 'port-name|description' in.txt
127.0.0.1
description
--
127.0.0.2
description
--
127.0.0.3
description
helpme
port-name
yay
port-name