The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 06-28-2009
shils shils is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 1
get line number using sed command

Hi,

If the file is as given below, please let me know if the command is right to get the like number containing the string - Earth with the "=" symbol.

Filename: example.txt
123|Earth|2009

sed '/Earth/
{
=
}' example.txt