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-27-2008 12:47 AM
problem with if statement equality cleansing_flame Shell Programming and Scripting 1 02-12-2008 10:57 AM
Case statement problem gzs553 UNIX for Advanced & Expert Users 6 11-14-2006 04:24 PM
if statement problem djt0506 UNIX for Dummies Questions & Answers 4 12-04-2005 08:16 PM
problem with an IF statement hcclnoodles Shell Programming and Scripting 2 04-17-2003 11:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-26-2001
coughlin74 coughlin74 is offline
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 10:25 AM..
  #2 (permalink)  
Old 09-27-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

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

Code:
if [ $server_busy = "" ];
then
...
fi
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0