There are vaguely similar answers here but nothing that could really answer my question. I am at a point in my bash script where I have to fill two arrays from an output that looks like the following:
part-of-the-file1:line_32
part-of-the-file1:line_97
part-of-the-file2:line_88
part-of-the-file2:line_93
What I need to do is pull out the files and line numbers in there own separate arrays. So far I have:
read FILES LINES <<<($(echo $INPUTFILES | xargs grep -n $id | cut -f1,2 -d':' | awk '{print $1 " " $2}'
with a modified IFS=':' but this doesn't work. I'm sure there are better solutions since I am NOT a scripting or tools wizard.