1
0
mirror of https://github.com/koalaman/shellcheck.git synced 2025-01-04 01:59:56 -08:00

Setting IFS=" " does not split if the on two or more spaces, i.e., "var1 var2". While without it, it splits into arr=("var1" "var2")

evandrocoan 2019-07-03 23:50:42 -03:00
parent f0f12de728
commit 12e03a3109

@ -28,11 +28,12 @@ If it's a line with multiple words (separated by spaces, other delimiters can be
```sh
# For bash
IFS=" " read -r -a array <<< "$var"
read -r -a array <<< "$var"
# For ksh
IFS=" " read -r -A array <<< "$var"
read -r -A array <<< "$var"
```
1. https://stackoverflow.com/questions/1469849
### Rationale: