Nbr_BD_Link=0
Nbr_BD_Link=`
sqlplus sysadm/${PSWD}@${DB_Name} << EOF | tail -4 | head -1 2>/dev/null
set head off feedback off ;
select count(*) from dba_db_links ;
exit ;
EOF `
echo ${Nbr_BD_Link}
if [ ${Nbr_BD_Link} != "0" ] ; then
execution fail on line if [ ${Nbr_BD_Link} != "0" ] ; then
Like this :
Enter user-name: SP2-0306: Invalid option.
Check_DB_Link_BR.sh[71]: user-name:: unknown test operator
Any idea ? Any help.
Many thanks.
Are you sure that the value of this variable will ever be 0 or do you mean if the value is null in terms of empty? Because then you might want to test with -z or if value is "".
What does this echo results ? If you expect some numeric value why are you getting string as result. Does it mean you statement not functioning correctly ?