]> git.ipfire.org Git - network.git/commitdiff
list: Add function to join a list.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Sep 2012 08:33:13 +0000 (08:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Sep 2012 08:33:13 +0000 (08:33 +0000)
functions.list

index 2308b1e9b9ac1145959971be5a5166bdbccc977c..fa22a6668f59b4782ebf4a7acab55e3409756047 100644 (file)
@@ -98,3 +98,13 @@ function list_count() {
 
        print "${counter}"
 }
+
+function list_join() {
+       local list=${1}
+       local delim=${2}
+
+       local ret
+       printf -v ret "${delim}%s" ${!list}
+
+       print "${ret:${#delim}}"
+}