In the Fish shell, how can I join an array with a custom separator?
Since fish 2.3.0 you can use the string
builtin:
string join ',' $ASD
The rest of this answer applies to older versions of fish.
One option is to use variable catenation:
echo -s ,$ASD
This adds an extra comma to the beginning. If you want to remove it, you can use cut
:
echo -s ,$ASD | cut -b 2-
For completeness, you can also put it after and use sed
:
echo -s $ASD, | sed 's/,$//'