Skip to content

Commit

Permalink
add Bash 4+ mapfile example
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjonbrazil committed Apr 29, 2022
1 parent 2f5dba4 commit 99f6771
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ Bash variable:
variable=($(cat data.json | jello -rl _.foo))
```

Bash array variable:
Bash array variable (Bash 4+):
```
mapfile -t variable < <(cat data.json | jello -rl _.foo)
```

Bash array variable (older versions of Bash):
```
variable=()
while read -r value; do
Expand Down

0 comments on commit 99f6771

Please sign in to comment.