Say I have the file data.log
with the following contents:
[12/Mar/2015] /var/lib/file1.txt
[12/Mar/2015] /var/lib/file2.txt
[12/Mar/2015] /var/lib/file3.txt
How can I use awk
and bash
to store the contents of this file into an array where [12/Mar/2015]
would be the element and /var/lib/fileN.txt
its key?