I've got bash script for counting rows in the reports. I have one array where all reports names are stored and in the loop I'm counting rows. However for some files my script receives binary operator expected error. Do anyone have a solution?
for i in ${ARRAY[@]}; do
if [ ! -f "$BASE_DIR/$i"* ];
then
echo "File not generated yet"
else
ARRAY2=$(wc -l < "$BASE_DIR/$i"*.tab | awk '{print $1-2}')
echo ${ARRAY2[$i]} $i
fi
*in this context will do globbing