Consider the following example file test.xml
1
test123
2
grep -E -m 1 -o "
(.*)
" test.xml
This will return "
test123
"
if you want only the value we need to pipe it further
grep -E -m 1 -o "
(.*)
" test.xml | sed -e 's,.*
\([^<]*\)
.*,\1,g'
This will return "test123"
--
Posted By Naresh Surampudi to
LearnAdmin at 4/10/2014 02:43:00 PM