|
How to compare null and space using single if condition
Hi
I have a input file with many fields and each filed will be with in double quotes(""). i want to check fields contains balnk,null or space using condition using if. when i write code as below for if condition its not working
a=`awk -F ',' '{gsub("\"", "", $1);'NF==0';printf $1}' temp.txt`
echo $a
if [ -z "$a" ] || ["$a" = " " ]
then
echo "1st filed contains null or space please correct"
else
echo " field has data"
fi
Error message:
Account_SourceFile_Validation.sh[288]: [ : not found.
Can any one help on this.
Thanks
|