From 9d16807a67b40648095b15edf59fb7d601b9b079 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 15:55:05 +0200 Subject: //retiolum/bin/hosts: use BRE @sed --- retiolum/bin/hosts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts index 6939f52c..bd0c77dc 100755 --- a/retiolum/bin/hosts +++ b/retiolum/bin/hosts @@ -6,6 +6,8 @@ netname=${1-retiolum} cd /etc/tinc/$netname/hosts for i in `ls`; do - sed -rn 's|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1\t'$i' '$i'.'$netname'|p' $i + sed -n ' + s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i' '$i'.'$netname'|p + ' $i done | sort -- cgit v1.2.3 From 8c11ee3de8b7554b29c30b4b15eabb1d90f89ea3 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 16:10:27 +0200 Subject: //util/bin/naturalvoices.att: use BRE @sed --- util/bin/naturalvoices.att | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att index 9a944d8b..07fb6e17 100755 --- a/util/bin/naturalvoices.att +++ b/util/bin/naturalvoices.att @@ -24,8 +24,8 @@ done (cd "$pwd/../.." && git submodule update --init) { - for arg; do echo "$arg"; done | sed -rn ' - s/^--(.*=.*)/\1/p;t + for arg; do echo "$arg"; done | sed -n ' + s/^--\(.*=.*\)/\1/p;t s/.*/text="${text+$text }&"/p;t ' cat< Date: Fri, 9 Sep 2011 16:12:44 +0200 Subject: //retiolum/bin/ipv6: use BRE @sed --- retiolum/bin/ipv6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retiolum/bin/ipv6 b/retiolum/bin/ipv6 index 65a1eaa1..34c6de71 100755 --- a/retiolum/bin/ipv6 +++ b/retiolum/bin/ipv6 @@ -13,7 +13,7 @@ if test `id -u` != 0; then fi file=/etc/tinc/retiolum/hosts/`hostname` -addr=`sed -rn 's|^Subnet *= *(42:[0-9A-Fa-f:]*/128)|\1|p' $file` +addr=`sed -n 's|^Subnet *= *\(42:[0-9A-Fa-f:]*/128\)|\1|p' $file` route=42::/16 start() { -- cgit v1.2.3 From a6521f5755d80ca09be88ca2f719fab526a88b43 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 16:14:15 +0200 Subject: //retiolum/scripts/tinc_setup/tinc-up: use BRE @sed --- retiolum/scripts/tinc_setup/tinc-up | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retiolum/scripts/tinc_setup/tinc-up b/retiolum/scripts/tinc_setup/tinc-up index ae7c68e6..9a557787 100755 --- a/retiolum/scripts/tinc_setup/tinc-up +++ b/retiolum/scripts/tinc_setup/tinc-up @@ -4,15 +4,15 @@ dirname="`dirname "$0"`" conf=$dirname/tinc.conf -name=`sed -rn 's|^ *Name *= *([^ ]*) *$|\1|p' $conf` +name=`sed -n 's|^ *Name *= *\([^ ]*\) *$|\1|p' $conf` host=$dirname/hosts/$name route4=10.7.7.0/24 -addr4=`sed -rn 's|^ *Subnet *= *(10\.[^ ]*) *$|\1|p' $host` +addr4=`sed -n 's|^ *Subnet *= *\(10\.[^ ]*\) *$|\1|p' $host` route6=42::/16 -addr6=`sed -rn 's|^ *Subnet *= *(42:[^ ]*) *$|\1|p' $host` +addr6=`sed -n 's|^ *Subnet *= *\(42:[^ ]*\) *$|\1|p' $host` ifconfig $INTERFACE up $addr4 route add -net $route4 dev $INTERFACE -- cgit v1.2.3 From a449098de8ded3ebcd4f02c6ba0d31f43fef86a8 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 16:17:33 +0200 Subject: //util/bin/anonbox.net: that sed-foo, again^_^ --- util/bin/anonbox.net | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/bin/anonbox.net b/util/bin/anonbox.net index d038cd0a..3b648afb 100755 --- a/util/bin/anonbox.net +++ b/util/bin/anonbox.net @@ -13,12 +13,12 @@ GET() { ## retrieve data eval "$(${GET-GET} | - sed -rn ' -s^

([[:alnum:]@.]+)

$\ + sed -n ' +s^

\([[:alnum:]@.]\+\)

$\ email="\1" ; p -s^

.*

$\ +s^

.*

$\ uri="\1/" ; p -s^

([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+) ([ap]).m.

$\ +s^

\([0-9]\+\)/\([0-9]\+\)/\([0-9]\+\) \([0-9]\+\):\([0-9]\+\) \([ap]\).m.

$\ Y=20\3 ; \ m=\1 ; \ d=\2 ; \ -- cgit v1.2.3 From 65359a9833155f3a3c27d51d318c0daf576e362c Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 16:26:00 +0200 Subject: //util/bin/dict.leo.org: use BRE @sed --- util/bin/dict.leo.org | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/util/bin/dict.leo.org b/util/bin/dict.leo.org index 6a9d9669..03f16b96 100755 --- a/util/bin/dict.leo.org +++ b/util/bin/dict.leo.org @@ -14,7 +14,7 @@ if test -d "$cache_dir" ; then else curl --silent "$url" fi | -sed 's/>\( *.\)/>\n\1/g' | sed -rn ' +sed 's/>\( *.\)/>\n\1/g' | sed -n ' s/[[:space:]]/ /g //,/<\/td>/b //,/^<\/td>/b @@ -23,7 +23,7 @@ sed 's/>\( *.\)/>\n\1/g' | sed -rn ' /