hok1man
Technical User
- Feb 16, 2008
- 102
Hi guys,
echo "xx pts/19 Mar 4 03:16 (10.2.3.20)"
I would like to get :
10.2.3.20
I tried
nawk '{sub(/\(|\)/,"");print $NF}'
the result
10.2.3.20)
but if i tried nawk '{sub(/\)/,"");print $NF}'
result
(10.2.3.20
seems like my "or" "|" operator doesnt work,
anyone can nail it?
It would be nice if someone can tell me in sed as well but one liner..
thanks.
echo "xx pts/19 Mar 4 03:16 (10.2.3.20)"
I would like to get :
10.2.3.20
I tried
nawk '{sub(/\(|\)/,"");print $NF}'
the result
10.2.3.20)
but if i tried nawk '{sub(/\)/,"");print $NF}'
result
(10.2.3.20
seems like my "or" "|" operator doesnt work,
anyone can nail it?
It would be nice if someone can tell me in sed as well but one liner..
thanks.