![]() |
|
|
|
|
|||||||
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| egrep | DNAx86 | Shell Programming and Scripting | 7 | 01-18-2008 04:59 AM |
| Egrep cheat sheet anywhere? Looking for meaning of egrep -c | leelm | UNIX for Dummies Questions & Answers | 2 | 01-11-2008 11:37 AM |
| egrep syntax question | DKNUCKLES | Shell Programming and Scripting | 1 | 11-18-2007 12:46 PM |
| Egrep Help | FuzzyNips | UNIX for Dummies Questions & Answers | 2 | 11-10-2004 12:25 PM |
| egrep -f | tine | UNIX for Dummies Questions & Answers | 2 | 06-25-2003 07:28 AM |
|
|
Submit Tools | LinkBack | Thread Tools | 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 |
| Forum Sponsor | ||
|
|
|
|||
|
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 12:36 PM. |
| Thread Tools | |
| Display Modes | |
|
|
|
The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
|
| 421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script rsync ftp scp recursive segmentation fault(coredump) sftp script snoop unix solaris change ip address stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute while loop within while loop shell script |