bash split string by delimiter and get first element code example Example: bash split variable by delimiter IFS='|' read -r -a arrayName <<< "$variable"