The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
searching and storing unknown number of lines based on the string with a condition
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Rules & FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
searching and storing unknown number of lines based on the string with a condition
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
05-01-2008
ghostdog74
Registered User
Join Date: Sep 2006
Posts: 1,448
Code:
awk 'BEGIN{RS=""} $0 ~ /code : 10/{ print $0 > "file_10" }' file
ghostdog74
View Public Profile
Find all posts by ghostdog74