The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
If Statement Problem.. LinuxRacr Shell Programming and Scripting 2 02-26-2008 08:47 PM
problem with if statement equality cleansing_flame Shell Programming and Scripting 1 02-12-2008 06:57 AM
Case statement problem gzs553 UNIX for Advanced & Expert Users 6 11-14-2006 12:24 PM
if statement problem djt0506 UNIX for Dummies Questions & Answers 4 12-04-2005 04:16 PM
problem with an IF statement hcclnoodles Shell Programming and Scripting 2 04-17-2003 07:53 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2001
Registered User
 

Join Date: Sep 2001
Location: Omaha, NE
Posts: 6
if statement problem

I keep getting an error at line 21, it doesn't like my if statement. Previously I have tried using (( )), but still get errors. The current error is that server_busy is not found. This is the script:
Code:
#! /bin/ksh
server_busy="na"
for file in $1 $2 $3 $4 $5 $6
do
 echo " ${file}\t\c"
 /eagle/progress/dlc/bin/proutil ${file} -C holder > /dev/null
 ret=$?
 case $ret in
    0) server_busy=""
       echo me
       echo "Not Active";;
   14) echo "Locked";;
   16) echo "Active in Multi-user mode";;
    *) echo "Recv'd Error [${ret}]";;
 esac
done
read dummy
echo ${server_busy}
~
~
~
~
~
:q
[mrc:/eagle/aix/scripts]vi startscript
#! /bin/ksh
DBPARAM="-spin 1 -bibufs 100 -n 35 -B 500 -L 64000 -directio -Mm 4096"
PDIR="/eagle/aix/params"
for i in `find /eagle/aix -name "APPSERVERS" -depth -print`
do
  appserver_list=`cat -v ${i}`
done
server_busy="na"
for file in $1 $2 $3 $4 $5 $6
do
 echo " ${file}\t\c"
 /eagle/progress/dlc/bin/proutil ${file} -C holder > /dev/null
 ret=$?
 case $ret in
    0) server_busy=""
       echo "Not Active";;
   14) echo "Locked";;
   16) echo "Active in Multi-user mode";;
    *) echo "Recv'd Error [${ret}]";;
 esac
 if ${server_busy} = "";
   then
   echo "Proserve ${file} -basename ${file}"
   if -f "${PDIR}/basename ${file}.pf" ]; then
    echo "Using parameter file ${PDIR}/basename ${file}.pf"
    /eagle/progress/dlc/bin/proserve ${file} -S basename ${file} -pf ${PDIR}/basename ${file}
   else
    /eagle/progress/dlc/bin/proserve ${file} -S basename ${file} -pf ${DBPARAM}
   fi
   /eagle/progress/dlc/bin/probiw ${file}
   /eagle/progress/dlc/bin/proapw ${file}
   /eagle/progress/dlc/bin/prowdog ${file}
 fi
done
   sleep 1
   for appsrvr in ${appserver_list}
   do
     /eagle/progress/dlc/bin/asbman -name ${appsrvr} -start
   done
added code tags --oombera

Last edited by oombera; 02-16-2004 at 06:25 AM.
Forum Sponsor
  #2 (permalink)  
Old 09-27-2001
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Try changing it to:

Code:
if [ $server_busy = "" ];
then
...
fi
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0