Unexpectedly, line numbers differ when adding sqlplus after it, it doesn't make any sense. Can someone explain please?
I get 721 on line count when I comment out "sqlplus"
./general_check.sh | wc -l
When I remove comment symbol-hash from sqlplus line I get 222 echo line count, same command
./general_check.sh | wc -l
Everything is exactly the same, why am I getting two different row counts for the same echo command?
general_check.sh
#!/bin/bash
## Declaration Section
##
export account_user=`cat user_pass`
export CUSTLIST="/tmp/special_list.lst"
export SQLDIR="../scripts"
$ORACLE_HOME/bin/sqlplus -S $account_user@db_name @${SQLDIR}/gen_special_list.sql
/bin/cat $CUSTLIST | while read CUST ORACLE_SID
do
########### 721 lines with sqlplus commented out, 222 when sqlplus below is commented in ##############
echo "|||||${CUST}|||||${ORACLE_SID}|||||"
#### trouble maker line below ####
sqlplus -S ${CUST}/${CUST}@${ORACLE_SID} @${SQLDIR}/ctx_silly.sql>> ../reports/ctx_silly.log
done
exit