The readarray
command (also spelled mapfile
) was introduced in bash 4.0.
readarray -t a < /path/to/filename
More Related Contents:
- How to split a string into an array in Bash?
- Reading output of a command into an array in Bash
- How to sort an array in Bash
- Passing arrays as parameters in bash
- Iterate over two arrays simultaneously in bash
- Compare/Difference of two arrays in Bash
- 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 pass an associative array as argument to a function in Bash?
- How to pass array as an argument to a function in Bash
- Bash array with spaces in elements
- How to return an array in bash without using globals?
- Exporting an array in bash script
- Arrays in unix shell?
- Reading a space-delimited string into an array in Bash
- A confusion about ${array[*]} versus ${array[@]} in the context of a bash completion
- 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]
- Assign to a bash array variable indirectly, by dynamically constructed variable name
- How to merge two arrays in a zipper like fashion in Bash?
- Assigning an Array Parsed With jq to Bash Script Array
- How can I join elements of a Bash array into a delimited string?
- Easiest way to check for an index or a key in an array?
- How to keep associative array order?
- How to find the length of an array in shell?
- How do I assign ls to an array in Linux Bash?