mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 11:19:45 +08:00
mention lack of simple error handling in mapfile
@@ -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.
|
||||
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.
|
||||
```
|
Reference in New Issue
Block a user