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

Re: joining array elements



On Jan 12, 10:22am, Wataru Kagawa wrote:
}
} 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.

Did you try *removing* the backslashes?  This works fine for me:

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

Also keep in mind that "echo" might be doing some conversions of its
own if you have anything unusual in $usernames -- you might be better
off with e.g.

print -R -- ${(j:[return]:)usernames}



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