[olug] need some quick help with sed

DYNATRON tech dynatron at gmail.com
Fri Dec 18 06:58:27 UTC 2009


i'm trying to strip an xml value into a variable in a bash script.

postID="$(echo `cat ./data.xml | grep postID`)"

but this gives me the entire line:    <postID>999999</postID>

i need $postID to equal 999999 and i've been trying to learn how to do this
with sed, but anything i try just outputs the entire line with the xml tags.
any suggestions? after 10 hours of coding in one day sed tutorials are just
making my head spin.




-- 
dynatron digital services
box 191 - 68037
www.dynatron.org
dynatron at gmail.com



More information about the OLUG mailing list