The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Search text from a file and print text and one previous line too
.
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
:
Search text from a file and print text and one previous line too
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
01-02-2009
kamranjalal
Registered User
Join Date: Oct 2008
Posts: 9
Please "cfajohnson" What should I change in the following command to find text and its previous line.
I got command (text=start; awk '/'"$text"'/{n=2}n-->0' filename) for finding text and next line.
Thanks for your help.
kamranjalal
View Public Profile
Find all posts by kamranjalal
Find kamranjalal's past nominations received
Find kamranjalal's present nominations given