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(-) (limited to 'retiolum/bin/hosts') 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