If I have an array like this in Bash:
FOO=( a b c )
How do I join the elements with commas? For example, producing a,b,c.
a,b,c
$ set a 'b c' d $ history -p "$@" | paste -sd, a,b c,d