From 12e03a310904690029e579ae72652ec432eaa78b Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Wed, 3 Jul 2019 23:50:42 -0300 Subject: [PATCH] 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") --- SC2206.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SC2206.md b/SC2206.md index d297693..be3162c 100644 --- a/SC2206.md +++ b/SC2206.md @@ -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: