var= "$(find . -name 'gen*.bt2')"
if [ "$var" == "" ]
then
echo bad
else
echo great
fi
I get errors
./script.sh: line 4: ./gen.4.bt2 ./gen.rev.1.bt2 ./gen.rev.2.bt2 ./gen.1.bt2 ./gen.3.bt2 ./gen.2.bt2: No such file or directory great
However, when I run the same code in terminal, files are listed perfectly, without any error.
Can someone correct me, where am I going wrong?
I need to check, if certain files are present or not, if present then proceed.