From: Michael Tremer Date: Sat, 19 Jun 2010 13:13:39 +0000 (+0200) Subject: network: Faster implementation of seq and lowercase. X-Git-Tag: 001~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3efecbb3f645d1fbdee5c963a5550539f8be09f8;p=network.git network: Faster implementation of seq and lowercase. --- diff --git a/functions.util b/functions.util index c7385416..8705726c 100644 --- a/functions.util +++ b/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}