String I want to sed i get from incoming sniffered packet... I want to get substring from string, f.e.
INVITE sip:[email protected]:5060 SIP/2.0
Using sed I would like to extract substring.
Substring is between sip: and @ ... So for my example, I need to get
18455845013
Input file
$ cat foo.txt
INVITE sip:[email protected]:5060 SIP/2.0
Result
$ sed 'y/:@/\r\n/;P;d' foo.txt
18455845013
: to \r@ to \nIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With