I have the following XML
<Audit_Type>1</Audit_Type><Session_Id>34505863</Session_Id>
<StatementId>1</StatementId><EntryId>1</EntryId>
<Extended_Timestamp>2012-03-06T10:25:20.789459</Extended_Timestamp>
<DB_User>KASINIY</DB_User>
<OS_User>majohn1</OS_User><OS_Process>28636</OS_Process>
<Terminal>CAIRVNBIS01</Terminal><Instance_Number>0</Instance_Number>
<Action>100</Action><TransactionId>0000000000000000</TransactionId><Returncode>0</Returncode><Comment_Text>Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.10)(PORT=4600))</Comment_Text><Priv_Used>5</Priv_Used>
Can somebody give me a SED/AWK statement that I can use to get
a spefic value.
To be efficient I would like the assign the value of a tag into a variable
and than use the variable in the parsing staement.
Ie
var=OS_User
sed $var .......
In addition, I may have 1 or many of these records in my file.
I may want to get the first, last or all occurances of $var
Thanks in advance to all who answer