« Back to Index

Bash split string by delimiter

View original Gist on GitHub

Bash split string by delimiter.sh

IN="bla@some.com;john@home.com"
arrIN=(${IN//;/ })
echo "${arrIN[@]}" # foo bar
echo $arrIN # foo