![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| egrep | DNAx86 | Shell Programming and Scripting | 7 | 01-18-2008 08:59 AM |
| Egrep cheat sheet anywhere? Looking for meaning of egrep -c | leelm | UNIX for Dummies Questions & Answers | 2 | 01-11-2008 03:37 PM |
| egrep syntax question | DKNUCKLES | Shell Programming and Scripting | 1 | 11-18-2007 04:46 PM |
| Egrep Help | FuzzyNips | UNIX for Dummies Questions & Answers | 2 | 11-10-2004 04:25 PM |
| egrep -f | tine | UNIX for Dummies Questions & Answers | 2 | 06-25-2003 10:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
question on egrep
Hi
I am trying to use this command: egrep '^a{2,6}$' testexpr4D to retreive lines with 2,3,4,5, or 6 a's in a file . The file testexpr4D has entries like: a aa aaa aaaa aaaaa aaaaaa 123456 ABCDEF I was expecting to see 5 lines in the output but nothing happens. Can anyone help please? Thanks Rohit |
|
||||
|
This works:
Code:
egrep '^(a)(a)?' filename Code:
kcsdev:/home/jmcnama> cat filename a aa aaa aaaa aaaaa aaaaaa 123456 ABCDEF kcsdev:/home/jmcnama> egrep '^(a)(a)?' filename a aa aaa aaaa aaaaa aaaaaa Code:
egrep '^(a)+$' filename Last edited by jim mcnamara; 05-19-2006 at 03:36 PM.. |
|
||||
|
put one 'a'
Put a single a before the mentioned pattern. You should get your result.
egrep '^a(a)+$' filename |
| Sponsored Links | ||
|
|