So i need to read all the lines from a text file(as an argument when i call the script) which contains numbers in this form(1 new line not 2):
num1:num2
num3:num4 etc
I use this command block:
while IFS= read line do IFS=':' read -r -a X <<< "$line" done < "$1" to read the lines and numbers and store it into array X but the array goes only to position 0 and 1 and when it changes line it just write the new number(eg num3) where the old number was(eg num1 in pos 0)
Any solution to this?
array=()and beforedoneinsertarray+=( "${X[@]}" )to append arrayXto arrayarray.