Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

joining array elements



Hi all,

I am trying to join array elements together using a string separator containing square brackets. For example, if I have,

usernames=( Bob Sara Tim )

I would like,

Bob[return]Sara[return]Tim

as an output (without the backslashes in front of the square brackets). I started out with,

echo ${(j:\[return\]:)usernames}

and added extra backslashes, but that did not work for me. Help is greatly appreciated.

Wataru Kagawa



Messages sorted by: Reverse Date, Date, Thread, Author