From a52ac6981668ae4a3a3718fe7cda1b4aa265a79e Mon Sep 17 00:00:00 2001 From: bolvan Date: Fri, 5 Jan 2018 01:35:30 +0300 Subject: [PATCH] further sed speed improvement --- ipset/create_ipset.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipset/create_ipset.sh b/ipset/create_ipset.sh index be1c1d7..d16fe80 100755 --- a/ipset/create_ipset.sh +++ b/ipset/create_ipset.sh @@ -14,9 +14,9 @@ do [ -f "$f" ] && { echo Adding to ipset $1 : $f if [ -f "$ZIPLIST_EXCLUDE" ] ; then - grep -vxFf $ZIPLIST_EXCLUDE "$f" | sort -u | sed -nre "s/^(.*)$/add $1 \1/p" | ipset -! restore + grep -vxFf $ZIPLIST_EXCLUDE "$f" | sort -u | sed -nre "s/^.*$/add $1 &/p" | ipset -! restore else - sort -u "$f" | sed -nre "s/^(.*)$/add $1 \1/p" | ipset -! restore + sort -u "$f" | sed -nre "s/^.*$/add $1 &/p" | ipset -! restore fi } done