I am familiar with shell programming in bash, but for some reason egrep -o to print only matching words is not working and displays error as below.
Envi
I am assuming this is a Solaris box you are connecting to. Solaris' version of grep does not have the -o option. So you can either
/usr/sfw/bin, or you might have luck with pkg install //solaris/text/gnu-grep); orSee on my box:
$ uname
SunOS
$ echo "i am a boy" | grep -o "am"
grep: illegal option -- o
Usage: grep -hblcnsviw pattern file . . .
$ echo "i am a boy" | /usr/sfw/bin/ggrep -o "am"
am
If you have perl :
echo "I am a boy" | perl -lne '/am/ && print $&'
am