For a Bash function my_fun
, how can I use a delimiter (e.g. ";") to split input into an array of strings?
Example input:
$ my_fun This is ; an example
Example output:
string1: This is
string2: an example
Perhaps using $IFS=';'
or the read
command?