well.. try removing export and also make sure the select query is returning a value.. apart from this i cant see any issues with your script..
---------- Post updated at 06:45 PM ---------- Previous update was at 06:35 PM ----------
Hi Bakunin,
Single quote wont do any harm in side sqlplus..
SQL> select ID from users where LOGINNAME='TALLYMAN';
ID
----------
0
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
gold0813*TPCRCST2>b="TALLYMAN"
gold0813*TPCRCST2>a=`sqlplus -s TALLYMAN/******** <<EOF
> set head off;
> set feedback off;
> select ID from users where LOGINNAME='$b';
> exit;
> EOF`
gold0813*TPCRCST2>echo $a
0
gold0813*TPCRCST2>