Hi,
here is the piece of code where i am getting error:
Code:
for i in DCP KIVR CCCD
do
${i}_A=`grep "2014-07-14 06" $DATA_DIR/${i}_hourly_paya.txt|awk -F '|' '{printf "%-10d\n",$2}'`
if [[ ! -n "${${i}_A}" ]]
then
echo 2014-07-14 06 0 >> $DATA_DIR/${i}_hourly_paya_TMP.txt
else
echo 2014-07-14 06 ${${i}_A} >> $DATA_DIR/${i}_hourly_paya_TMP.txt
fi
done
output:
$ ./san_tst.sh
./san_tst.sh: line 4: syntax error at line 12: `!' unexpected
could someone please help?