From 5c860b36abf8797e5736e634d3059f1e46547c58 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 23 Feb 2019 13:29:22 -0800 Subject: [PATCH] Use `IFS=''` for bash3 example --- SC2207.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SC2207.md b/SC2207.md index 5c87a74..8f1d22f 100644 --- a/SC2207.md +++ b/SC2207.md @@ -15,7 +15,7 @@ If it outputs multiple lines, each of which should be an element: mapfile -t array < <(mycommand) # For bash 3.x+ -while IFS=$'\n' read -r line; do array+=("$line"); done < <(mycommand) +while IFS='' read -r line; do array+=("$line"); done < <(mycommand) # For ksh mycommand | while IFS="" read -r line; do array+=("$line"); done