Category: Uncategorized

Convert a delimited string into an array in Bash

If you’ve got a string of items in bash which are delimited by a common character (comma, space, tab, etc) you can split that into an array quite easily. Simply (re)define the IFS variable to the delimiter character and assign the values to a new variable using the array=($<string_var>) syntax. The new variable will now be an array of …

Start reading Convert a delimited string into an array in Bash