Split a delimited string into an array.
Section: String Operations
Split string into array
bash
bash
IFS=, read -r -a parts <<< 'red,green,blue'
printf '%s
' "${parts[@]}"Explanation
Use IFS carefully because it affects word splitting.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing String Operations