The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Need help in sed command [ printing a pattern + its line no or line no alone ]
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Need help in sed command [ printing a pattern + its line no or line no alone ]
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
06-28-2009
shils
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
shils
View Public Profile
Find all posts by shils
Find shils's past nominations received
Find shils's present nominations given