if $RETURN_VAL1GUE -ne 0;


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers if $RETURN_VAL1GUE -ne 0;
# 1  
Old 10-14-2009
if $RETURN_VAL1GUE -ne 0;

Hello,

Below script errors out and I don't know if because command is not compatible with Linux OS version.


Code:
# stop the concurrent manager
$COMMON_TOP/admin/scripts/$CONTEXT_NAME/adstpall.sh $DB_USER/$DB_PSWD

# check if the processes are alive

SPOOL_FILE="$APPLTMP/stop_cm_$TWO_TASK.tmp"
while : ; do
sqlplus -silent $DB_USER/$DB_PSWD << EOF
spool $SPOOL_FILE
select concurrent_queue_name, running_processes
from fnd_concurrent_queues
where running_processes > 0;
spool off
EOF

egrep -q "no rows selected" $SPOOL_FILE
RETURN_VALUE=$?

if $RETURN_VAL1GUE -ne 0; then
echo "Concurrent manager processes are still active. Sleeping for 10 seconds..."
sleep 10
fi
done

rm $SPOOL_FILE
echo "** Concurrent Manager and its processes are stopped **"


if $RETURN_VAL1GUE -ne 0; then  <<<<  no rows selected

./stop_tst_db3_appl: line 34: -ne: command not found



Is -ne not part of the linux command?


thanks you

Last edited by vgersh99; 10-14-2009 at 01:55 PM.. Reason: code tages PLEASE!
# 2  
Old 10-14-2009
Code:
if [ $RETURN_VAL1GUE -ne 0 ]; then



---------- Post updated at 12:55 PM ---------- Previous update was at 12:55 PM ----------

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums
# 3  
Old 10-14-2009
Thank you for quick reply I tried that already and error message is as below

Code:
SPOOL_FILE="$APPLTMP/stop_cm_$TWO_TASK.tmp"
while : ; do
sqlplus -silent $DB_USER/$DB_PSWD << EOF
spool $SPOOL_FILE
select concurrent_queue_name, running_processes
from fnd_concurrent_queues
where running_processes > 0;
spool off
EOF

egrep -q "no rows selected" $SPOOL_FILE
RETURN_VALUE=$?

if [$RETURN_VALUE -ne 0]; then
echo "Concurrent manager processes are still active. Sleeping for 10 seconds..."
sleep 10
fi
done

rm $SPOOL_FILE
echo "** Concurrent Manager and its processes are stopped **"
                                                                      

line 34: [0: command not found

# 4  
Old 10-14-2009
Quote:
Originally Posted by Paul.S
Thank you for quick reply I tried that already and error message is as below

Code:
SPOOL_FILE="$APPLTMP/stop_cm_$TWO_TASK.tmp"
while : ; do
sqlplus -silent $DB_USER/$DB_PSWD << EOF
spool $SPOOL_FILE
select concurrent_queue_name, running_processes
from fnd_concurrent_queues
where running_processes > 0;
spool off
EOF

egrep -q "no rows selected" $SPOOL_FILE
RETURN_VALUE=$?

if [$RETURN_VALUE -ne 0]; then
echo "Concurrent manager processes are still active. Sleeping for 10 seconds..."
sleep 10
fi
done

rm $SPOOL_FILE
echo "** Concurrent Manager and its processes are stopped **"
                                                                      

line 34: [0: command not found

This is NOT what I posted - pay attention to the spaces surrounding '[' and ']'
# 5  
Old 10-14-2009
Thanks vgersh99.

[ SPACE code SPACE ] how that make such big difference.
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question