String Join in a Shell Script

Oct 30th, 2007No Comments

I googled around for how to join a string in a shell and I found a very cool recipe:

function str_join() {
echo “@*”|tr ‘ ‘ ‘:’
}

I’ve never used `tr` before. This goes back on the list of old-school UNIX commands I need to do more research on.

Leave a Reply

You must be logged in to post a comment.