I have an array of applications, initialized like this:
depends=$(cat ~/Depends.txt)
When I try to parse the list and copy it to a new arra
The simplest way to copy a non-associative array in bash is to:
arrayClone=("${oldArray[@]}")
or to add elements to a preexistent array:
someArray+=("${oldArray[@]}")
Newlines/spaces/IFS in the elements will be preserved.
For copying associative arrays, Isaac's solutions work great.