If i want to get the lines containing exact word ignoring the lines which consists of same word embedded as part of another word,i can use grep like this:
$inputline = "sriram sriraman raja rajaram"
sol : echo $inputline | grep '\<sriram\>' selects the line containing a separate word sriram, but not the line which contains words like sriraman sriramkumar etc..
No comments:
Post a Comment