From 805243f645e954fa595519dc571c11b8fe0c95df Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 10 Sep 2012 08:33:13 +0000 Subject: [PATCH] list: Add function to join a list. --- functions.list | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functions.list b/functions.list index 2308b1e9..fa22a666 100644 --- a/functions.list +++ b/functions.list @@ -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}}" +} -- 2.47.3