summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@xso>2011-09-09 16:35:50 +0200
committertv <tv@xso>2011-09-09 16:35:50 +0200
commitb5b3f257697ae684474d43ca1e4d5656bf3ee9c4 (patch)
tree7048b9f7a20ec6c1401d0f62a5b05f26ece470a2
parent65359a9833155f3a3c27d51d318c0daf576e362c (diff)
//util/bin/my-global-ipv4-addr: use BRE @sed
-rwxr-xr-xutil/bin/my-global-ipv4-addr3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/bin/my-global-ipv4-addr b/util/bin/my-global-ipv4-addr
index 305d3f80..71608a8a 100755
--- a/util/bin/my-global-ipv4-addr
+++ b/util/bin/my-global-ipv4-addr
@@ -8,7 +8,8 @@
if test $# = 1; then
has() { type "$1" 1>/dev/null 2>/dev/null; }
parse() {
- sed -rn 's/.*((1?[0-9][0-9]|2[0-5][0-9])\.(1?[0-9][0-9]|2[0-5][0-9])\.(1?[0-9][0-9]|2[0-5][0-9])\.(1?[0-9][0-9]|2[0-5][0-9])).*/\1/p' | grep .
+ sed -n 's/.*\(\(1\?[0-9][0-9]\|2[0-5][0-9]\)\.\(1\?[0-9][0-9]\|2[0-5][0-9]\)\.\(1\?[0-9][0-9]\|2[0-5][0-9]\)\.\(1\?[0-9][0-9]\|2[0-5][0-9]\)\).*/\1/p' |
+ grep .
}
get () {
# TODO get random valid user agent