I am using /usr/bin/ksh in AIX
I am reading the values of $dbname, $dbatmpdir/dbdir.$$, and $scope from a different file
All I have to do is check if $dbname exists in file $dbatmpdir/dbdir.$$ and
$scope should have a value either 'TABLE' or 'SCHEMA'.
When I execute the following code. I am getting the below error.
Also please explain about the trick involved in using a single '[' or '[[' with if loop.
if [ `grep $dbname $dbatmpdir/dbdir.$$` && $scope == 'TABLE' || $scope == 'SCHEMA' ]; then
echo "valid"
else
echo "invalid"
fi
ksh: test: 0403-021 A ] character is missing.
ksh: TABLE: not found.
invalid
Thanks in advance