How can I join elements of a Bash array into a delimited string?
A 100% pure Bash function that supports multi-character delimiters is: function join_by { local d=${1-} f=${2-} if shift 2; then printf %s “$f” “${@/#/$d}” fi } For example, join_by , a b c #a,b,c join_by ‘ , ‘ a b c #a , b , c join_by ‘)|(‘ a b c #a)|(b)|(c join_by ‘ %s … Read more