Valor de retorno do script sql para o shell script

Eu tenho o script de shell que chama o seguinte script sql:

     INSERT INTO SEMANTIC.COUNT_STATISTICS (...);
     UPDATE SEMANTIC.COUNT_STATISTICS 
     SET PRNCT_CHANGE = 1.1;


  --want to store result of this bellow select statement in model_count variable

      select PRNCT_CHANGE
      FROM SEMANTIC.COUNT_STATISTICS
      WHERE model = '&MY_MODEL'
      AND NEW_DATE = (
                      select max(NEW_DATE)
                      from SEMANTIC.COUNT_STATISTICS
                      where MODEL = '&MY_MODEL'
                     );

Agora, como eu retorno essa variável PERCENTAGE_NUMBER de volta ao meu script de shell?

Meu shell script é o seguinte:

#!/bin/bash
#
# setup oracle, java, and d2rq environment
. /etc/profile.d/oracle.sh
. /etc/profile.d/java.sh
. /etc/profile.d/d2rq.sh

cd /opt/D2RQ

model_count=$(sqlplus user/pass @count.sql 'MODEL')

if ["$model_count" > 0]; then
   echo "percentage count is positive"
else
   echo "its negative"

Eu gostaria que o último resultado da instrução SELECT fosse armazenado na minha variável model_count no shell script.

Alguém sabe por que não está funcionando?

questionAnswers(2)

yourAnswerToTheQuestion