Tag Archives: Mails Pending

Help with error "por: 0403-012 A test command parameter is not valid."

By blacksteel1988

Hi, im asking for help with the next script:

Code:

echo ^[[32m Mails Pending ^[[37m
VAR1=`query1.sh`

if [ $VAR1 -ge 200 ];
then
if [ $VAR1 -ge 300 ]
then
printf "33[01;31m%s33[00mn" "$VAR1"
else
printf "33[01;33m%s33[00mn" "$VAR1"
fi
else
printf "33[01;32m%s33[00mn" "$VAR1"
fi

echo " "

sleep 30
clear
done;


query1.sh:

Code:

export TERM=vt100
export ORACLE_TERM=at386
export ORACLE_HOME=/home_oracle8i/app/oracle/product/8.1.7
export ORACLE_BASE=/home_oracle8i/app/oracle
export DBVISIT_HOME=/usr/local/dbvisit

PATH=/home_oracle8i/app/oracle/product/8.1.7/bin:/usr/ccs/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME
/bin:/usr/bin/X11:/sbin:$DBVISIT_HOME:.
export PATH
export ORACLE_SID=ORAB817
export DISPLAY=192.9.200.121:0.0
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
export ORA_ENCRYPT_LOGIN=TRUE
set umask=022
sqlplus -s " / as sysdba " @query1.sql


query1.sql:

Code:

set serveroutput on
set feedback off
set head off

SELECT 'MAILS PENDING : ' || COUNT ( * ) "Correo Por Enviar" FRO
M SCHEMA.CSIC_MAILS_fOR_SEND@VIRT.DB.TGU.COM WHERE estado = 0;

exit;


When i execute the script it returns what i want, but before that it always gives me the error “j.sh[224]: por: 0403-012 A test command parameter is not valid.”

From: http://www.unix.com/shell-programming-scripting/221405-help-error-por-0403-012-test-command-parameter-not-valid.html