String to array using a delimeter

stack_arr=(${1//,/ })

the space between / and } is very important. Without it, the splitting does not occur. Instead it replaces the “:” with an empty space

Leave a Reply

Your email address will not be published.