From: Michael Tremer Date: Sat, 19 Jun 2010 13:13:39 +0000 (+0200) Subject: network: Faster implementation of seq and lowercase. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e148756f0e3f85b117ddb528f3b0be5ffbd064d;p=ipfire-3.x.git network: Faster implementation of seq and lowercase. --- diff --git a/pkgs/core/network/src/functions.util b/pkgs/core/network/src/functions.util index c7385416c..8705726ca 100644 --- a/pkgs/core/network/src/functions.util +++ b/pkgs/core/network/src/functions.util @@ -236,6 +236,20 @@ function uppercase() { echo "${input^^}" } +function lowercase() { + local input + read input + echo "${input,,}" +} + +function seq() { + if [ $# -eq 2 ]; then + eval echo {${1}..${2}} + elif [ $# -eq 3 ]; then + eval echo {${1}..${3}..${2}} + fi +} + function beautify_time() { local value=${1}