Hi All
i have created a file as below
cat > REJ_FILE_LIST.dat
CUST.DAT,$ABC/TEST.DAT|$ABC/TEST1.DAT|$ABC/TEST2.dat
Ctrl+d
in another script the variable is set as
ABC='/data/proj/Cust'
the requirement is to read the second column from file REJ_FILE_LIST.dat which contains list of files delimited by '|' whose path is parameterised with variable ABC which is set in the script and from withing the script and i need to find total number of records contained by the list of files.
in the script i have used
FileLst=`cut -d, -f2,2 TEST.dat |tr '|' ' '` ----> To read the col 2
TotRecCnt=`wc -l $FileLst|tail -1|tr -d ' '|sed 's/[a-z,A-Z]//g'` ---->to fetch the total record count of the file list
but the problem is the variable ABC is not being replaced by its value instead the whole of column 2 is being considered as string (along with $)
so TotRecCnt is parsed as
wc -l $ABC/TEST.DAT $ABC/TEST1.DAT $ABC/TEST2.dat
Please help