mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2207 (markdown)
@@ -15,9 +15,11 @@ If it outputs multiple lines, each of which should be an element:
|
||||
mapfile -t array < <(mycommand)
|
||||
|
||||
# For bash 3.x+
|
||||
array=()
|
||||
while IFS='' read -r line; do array+=("$line"); done < <(mycommand)
|
||||
|
||||
# For ksh
|
||||
array=()
|
||||
mycommand | while IFS="" read -r line; do array+=("$line"); done
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user