@ubuntu:/tmp$ cat one.xml
<?xml version="1.0" encoding="UTF-8"?>
<e2frontendstatus>
<e2snrdb>
12.10 dB
</e2snrdb>
<e2snr>
75 %
</e2snr>
<e2ber>
0
</e2ber>
<e2acg>
99 %
</e2acg>
</e2frontendstatus>
@ubuntu:/tmp$ sed -n -e 's/.*<e2ber>\([0-9][0-9]*\)<\/e2ber>.*/\1/p' one.xml
@ubuntu:/tmp$
I want to get the value betwen . But it’s not working, what I am doing wrong?
What value are you looking for? Do you know that Linux’s grep has an “After context” and “Before Context” command line parameters? That might be the easiest way of pulling of the information you’re looking for.
For example, if you’re trying to get the value after the line , you could do something like this: