Here is my problem.
I create a .lst file containing the following:
-rw-rw-r-- 1 dvpears prism 19040 Sep 25 10:56 dax_e_ic_20030828.csv
-rw-rw-r-- 1 dvpears prism 19042 Sep 25 10:56 dax_e_ic_20030829.csv
-rw-rw-r-- 1 dvpears prism 71 Sep 25 10:56 dax_e_in_20030828.csv
-rw-rw-r-- 1 dvpears prism 71 Sep 25 10:56 dax_e_in_20030829.csv
Then I want to cycle through the contents of the .lst file, record by record, assigning each column into a variable.
My loop would be:
for rec in $(cat $LIVE_WORK/serverfiles.lst)
do
.
.
.
The problem I have is that for the 1st row in the .lst file, $rec is returning the following:
-rw-rw-r--
instead of
-rw-rw-r-- 1 dvpears prism 19040 Sep 25 10:56 dax_e_ic_20030828.csv
I think it is because of the spaces between each data item. How do I get the whole row assigned in $rec?
Any help greatly appreciated.
I create a .lst file containing the following:
-rw-rw-r-- 1 dvpears prism 19040 Sep 25 10:56 dax_e_ic_20030828.csv
-rw-rw-r-- 1 dvpears prism 19042 Sep 25 10:56 dax_e_ic_20030829.csv
-rw-rw-r-- 1 dvpears prism 71 Sep 25 10:56 dax_e_in_20030828.csv
-rw-rw-r-- 1 dvpears prism 71 Sep 25 10:56 dax_e_in_20030829.csv
Then I want to cycle through the contents of the .lst file, record by record, assigning each column into a variable.
My loop would be:
for rec in $(cat $LIVE_WORK/serverfiles.lst)
do
.
.
.
The problem I have is that for the 1st row in the .lst file, $rec is returning the following:
-rw-rw-r--
instead of
-rw-rw-r-- 1 dvpears prism 19040 Sep 25 10:56 dax_e_ic_20030828.csv
I think it is because of the spaces between each data item. How do I get the whole row assigned in $rec?
Any help greatly appreciated.