< BACK
Bash tips, tricks and code snippets
Read one per line output into an array
Using readarray
and the heredoc syntax, e.g.
read -r -d '' LIST <<'EOF'
man
sudo
mc
vim
jq
nmap
EOF
readarray -t pkg <<<"${LIST}"
< BACK
Using readarray
and the heredoc syntax, e.g.
read -r -d '' LIST <<'EOF'
man
sudo
mc
vim
jq
nmap
EOF
readarray -t pkg <<<"${LIST}"