a=(foo bar "foo 1" "bar two") #create an array
b=("${a[@]}") #copy the array in another one
for value in "${b[@]}" ; do #print the new array
echo "$value"
done
More Related Contents:
- Loop through an array of strings in Bash?
- Check if a Bash array contains a value
- Creating an array from a text file in Bash
- Reading output of a command into an array in Bash
- How can I store the “find” command results as an array in Bash
- How can I join elements of an array in Bash?
- Passing arrays as parameters in bash
- Iterate over two arrays simultaneously in bash
- Capturing output of find . -print0 into a bash array
- Read lines from a file into a Bash array [duplicate]
- Add new element to existing JSON array with jq
- Remove an element from a Bash array
- How do I assign the output of a command into an array?
- How to slice an array in Bash
- How to return an array in bash without using globals?
- Accessing a JSON object in Bash – associative array / list / another model
- Print array elements on separate lines in Bash?
- Reading a space-delimited string into an array in Bash
- Bash indirect array addressing?
- Convert command line arguments into an array in Bash
- Read tab-separated file line into array
- How to check if element exists in array with jq
- I am getting error “array.sh: 3: array.sh: Syntax error: “(” unexpected”
- Convert multiline string to array [duplicate]
- How to pass an array argument to the Bash script
- Assign to a bash array variable indirectly, by dynamically constructed variable name
- How to merge two arrays in a zipper like fashion in Bash?
- How can I join elements of a Bash array into a delimited string?
- How do I assign ls to an array in Linux Bash?
- Check if an element is present in a Bash array [duplicate]