Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi
Suppose a file F1 conatins following entries
ABCD0B
ABCD0Bs
ABCD0B.kshI would like to grep the word that contains only '0B' as last 2 charcaters.
When I tried grep command : grep '0B' F1
it results me following linesABCD0B
ABCD0Bs
ABCD0B.kshwhere I wanted , result should be only the line ABCD0B.
I tried grep with pattern ????0B , that also has not given me correct result.
Can any one help me, what pattren I have to use with grep command to get the correct result.
Thanks and Regards
Chinmaya

check the man page of your grep command. for me, my grep command has the -E option which can be used for regular expression.
For me, the command is
grep -E "0B$" F1

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |