I have a bash script like this:
vartest=(`/usr/local/pgsql/bin/psql -h 10.0.1.143 -t -p 6432 -d gpperfmon -c "select delete_oldest_db_test();"`)
echo ${vartest[2]}
what_to_delete=${vartest[2]}
if ["$what_to_delete" == "Nothing"]; then
echo "Nothing to delete"
else
dropdb -h 10.0.1.143 -p 6432 -U postgres ${vartest[0]}
fi
But when I run it I get this:
line 7: [Nothing: command not found
I've tried to compare using quotes, double quotes, no quotes at all, and nothing seems to work.. The issue is in this line:
if ["$what_to_delete" == "Nothing"]; then
Thanks