Updated SC2206 (markdown)

Vidar Holen
2020-04-22 19:15:30 -07:00
parent 10e1694d50
commit b3222e1a2d

@@ -27,11 +27,8 @@ printf '%s\n' "$var" | while IFS="" read -r line; do array+=("$line"); done
If it's a line with multiple words (separated by spaces, other delimiters can be chosen with IFS), each of which should be an element: If it's a line with multiple words (separated by spaces, other delimiters can be chosen with IFS), each of which should be an element:
```sh ```sh
# For bash # For bash and ksh
read -r -a array <<< "$var" IFS=" " read -r -a array <<< "$var"
# For ksh
read -r -A array <<< "$var"
``` ```
1. https://stackoverflow.com/questions/1469849 1. https://stackoverflow.com/questions/1469849