In bash, in some StackOverflow answers they show how to populate the results to find files into an array:
Info 1
Older bash versions
mapfile -d $'\0' array < <(find . -name "${input}" -print0)
OR newer bash versions: (4.2+)
readarray -d '' array < <(find . -name "$input" -print0)
Info 2
Then there is also this to split a string into an array but this doesn't work for me.
readarray -d '|' PORTS <<< "${matched}"
I use this successfully, but this is older syntax.
IFS='|' read -r -a PORTS <<< $matched
Those answers do not explain the full syntax though:
Can someone please explain:
Info 1:
What is the the < bracket just before the normal ( bracket doing? If I add a space and/or replace that with a $ then the command fails. But I would like to understand what that is doing.
Info 2:
Somewhere I found this syntax for readarray, but it doesn't work for me, so it could be the same issue with the bracket < placements. How to use it correctly?