The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 05-22-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by shereenmotor
Code:
egrep '^a\{2,6\}$' testexpr4D
shereenmotor, that solution is pretty close, but no cigar !

You are mixing the syntax's of sed and [e]grep.

If it were sed, it would be

Code:
sed -n -e "/^a\{2,6\}$/p" filename
If it were grep it would be

Code:
egrep '^a{2,6}$' filename