Sunday, 1 January 2017

Shell Script 13 : Regular Expression (c)

You can also for matches that appear at the beginning or end of words, not whole lines.
jtony@genoa:~/learn/shell$ cat test
specialize
aaaaaaaaaa
tomcat
tom
atom
tom333
jyjtom
specialise
jtony@genoa:~/learn/shell$ grep '\<tom' test
tomcat
tom
tom333
jtony@genoa:~/learn/shell$ grep 'tom\>' test
tom
atom
jyjtom

No comments:

Post a Comment