The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
search for lines in a file
.
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 for lines in a file
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
04-22-2008
shalua
Registered User
Join Date: Apr 2007
Posts: 18
sed
-n -e '/BBB/p' -e '/AAA/p' emp.dat |
sed
-n '$='
works for me on the command line and gives me the count of lines matching either of these two patterns. But when I put it in the shell script, it returns errors.
shalua
View Public Profile
Find all posts by shalua
Find shalua's past nominations received
Find shalua's present nominations given