From 6e4769101a16a53c751a0b85559d784311e9f2de Mon Sep 17 00:00:00 2001 From: Schlomo Schapiro Date: Tue, 15 Dec 2020 21:52:45 +0100 Subject: [PATCH] mention lack of simple error handling in mapfile --- SC2207.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SC2207.md b/SC2207.md index dbaf47a..08f5aa3 100644 --- a/SC2207.md +++ b/SC2207.md @@ -56,4 +56,7 @@ This prevents the shell from doing unwanted splitting and glob expansion, and th ### Exceptions: -If you have already taken care (through setting IFS and `set -f`) to have word splitting work the way you intend, you can ignore this warning. \ No newline at end of file +If you have already taken care (through setting IFS and `set -f`) to have word splitting work the way you intend, you can ignore this warning. + +Another exception is the wish for error handling: `array=( $(mycommand) ) || die-with-error` works the way it looks while a similar `mapfile` construct like `mapfile -t array < <(mycommand)` **doesn't fail** and you will have to write more code for error handling. +``` \ No newline at end of file