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 -->
  #7 (permalink)  
Old 04-22-2008
shalua shalua is offline
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.