How to read a string into an array and get values ββfrom an array
I currently have
DATE_LIST=$(cat "$OUT_FILE" | xmlstarlet sel -T -t -m "//*[local-name()='entry']//*[local-name()='$start_position_date'][@name='beginposition']" -v '.' -n)
The result looks something like this:
DATE_LIST= 2015-10-10 2015-11-11
... etc.
IFS='\n' read -a array <<< "$DATE_LIST"
echo "${array[0]}" //I get the first one
echo "${array[1]}" //I get nothing
How to disassemble it correctly? DATE_LIST
generated from xml and strings are split \n
.
+3
source to share