On 07/04/15 17:29, Rich Shepard wrote:
> On Sat, 4 Jul 2015, Pete Lancashire wrote:
> 
>> $ cat p | egrep -cE '^P[[:digit:]]{5}'
>> 4
> 
> [rshepard@salmo ~]$ cat p | egrep -cE '^P[[:digit:]]{5}' hrwq.dat
> cat: p: No such file or directory
> 0
> [rshepard@salmo ~]$ cat hrwq.dat | egrep -cE '^P[[:digit:]]{5}'
> 0
> 
> Still no joy. Let's let it rest.


galens@lion:~$ cat test.txt
foo
P12345
P1234a
P1234
bar
Pbaz
P
P567890hello
P56789world

galens@lion:~$ grep -c '^P' test.txt
7
galens@lion:~$ grep -c '^P[0-9]' test.txt
5
galens@lion:~$ grep -c '^P[0-9]\{5\}' test.txt
3
galens@lion:~$ grep --version
GNU grep 2.6.3


galen
-- 
Galen Seitz
[email protected]
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to