bash join array with string code example
Example: make a join function in bash script arrays
function join_by { local d=$1; shift; local f=$1; shift; printf %s "$f" "${@/#/$d}"; }
function join_by { local d=$1; shift; local f=$1; shift; printf %s "$f" "${@/#/$d}"; }