[Linux Tips] grep and cut

aloha:~/Documents/Codes samtz$ grep cfgversion test.xml

<fileHeader fileversion=”0.1.0.1″ filename=”test.xml” filetype=”xml” cfgversion=”33″ cfgmversion=”0″ cfgsversion=”0″ swversion=”1.0.1.0″ sendname=”la la” vendername=”xx”/>

aloha:~/Documents/Codes samtz$ grep cfgversion test.xml | cut -d \” -f7 | cut -d = -f1

cfgversion

aloha:~/Documents/Codes samtz$ grep cfgversion test.xml | cut -d \ -f7 | cut -d = -f2

“33”