[Bash] Join array elements with a delimiter

Created on November 30, 2026

Use IFS with "${array[*]}" to join the elements of an array. Inside double quotes, the expansion separates elements with the first character of IFS. This example sets it to a comma.

items=(apple banana cherry)
IFS=,
echo "${items[*]}"

Output

apple,banana,cherry
Bash Shell command