bash variable assignments must not have spaces around the =
array=(one two three)
To join using a single character, IFS is your friend:
IFS=,
# .....v.......................................v.............v...v
sed -e 's/value = " text to replace "/value = "'"${array[*]}"'"/g'
# ..............................................^^^^^^^^^^^^^
My quoting is very deliberate there. I've marked where the single quotes start and stop, and the array expansion must be enclosed in double quotes.
Overall, you were pretty close. Have to be careful with the whitespace, bash can be very sensitive to it.
IFS
is the shell's "internal field separator" -- it is used to
split a string into fields
line="foo,bar:baz"
IFS=':,'
read first second third <<<"$line"
declare -p first second third
join array elements into a single string
set -- a b c d
IFS=':,'
echo "$*" # _must_ be quoted
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…