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
.
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
.
This takes care of the extra comma at the end also. I am no bash expert. Just my 2c, since this is more elementary and understandable
printf solution that accept separators of any length (based on @doesn't matters answer)
or