Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I have wirtten a script but it is throwing error as below:
"no closing quote"
Please look into this and help me at the earliest as I have to complete it today itself.
The script is as below:
#!/bin/ksh
#Purpose : To restart the CQ processes on the server.
#****************************************************************************
`echo "cd /home/xmuser/CQ/var/bin"`
`echo ". ./xmenv.ksh"` |ftfping >ftfping.txt
var= `echo "more ftfping.txt |grep SUCCESSFUL |wc -l`
if [[ $var -ne 1 ]]; then
./xmstop.ksh
var1=`ps -eaf |grep run.sh|wc -l`
if [[ $var1 -ne 1 ]]; then
for PIDs in `ps -eaf |grep run.sh|awk '{print $2}'`
do
kill -9 $PIDs
done
fi
var2=`ps -eaf |grep xmuser|wc -l`
if [[ $var2 -ne 1 ]]; then
for PIDs in `ps -eaf |grep xmuser| grep -E "xmocoord|/home/xmuser/|/home/db2inst1/|Coordinator|" |awk '{print $2}'`
do
kill -9 $PIDs
done
fi
for QM in `more Queuemanager`
do
endmqm -i $QM
var3=`ps -eaf |grep mqm|wc -l`
if [[ $var3 -ne 1 ]]; then
for PIDs in `ps -eaf |grep mqm |awk '{print $2}'`
do
kill -9 $PIDs >junk
rm junk
done
fi
strmqm $QM
var4=`dspmq |grep Running|wc -l`
if [[ $var4 -ne 1 ]]; then
echo "Queuemanager not started,please check the logs"
fi
done
for QM in `more Queuemanager`
do
echo "dis chs(*)" |runmqsc -w 30 $QM >chl.txt
var5=`more chl.txt|grep AMQ8417|wc -l`
if [[ $var5 -ne 0 ]]; then
for CHANNEL in `more chl.txt |awk {'print $1'} |grep CHANNEL`
do
echo "start $CHANNEL " |runmqsc -w 30 $QM >>StartMQObjects_Log
var6=`more StartMQObjects_Log|grep AMQ8018|wc -l`
if [[ $var6 -eq 1 ]]; then
echo "$CHANNEL ON $QM STARTED"
else
echo "$CHANNEL ON $QM NOT STARTED"
fi
done
else
echo "NO CHANNEL ON $QM STARTED"
more chl.txt >>StartMQObjects_Log
fi
done
rm chl.txt
. ./xmenv.ksh |./xmstart.ksh -e
var7=`ps -eaf |grep xmuser| grep -E "xmocoord|/home/xmuser/|/home/db2inst1/|Coordinator|" |wc -l`
if [[var7 -eq 37 ]]; then
ftfping >ftfping.txt
var8= `echo "more ftfping.txt |grep SUCCESSFUL |wc -l`
if [[ $var8 -eq 1 ]]; then
echo"Restart of ENTERPRISE SERVER successful"
fi
fi
fi
I checked (in vim with colours) but I could not find 'the lone quote'.
I was also wondering what the purpose of this is: Coordinator|"
Find Coordinator |or nothing?
Hi,
As mentioned previously,I am able to solve the errors .But,now I am getting anew error
its saying
line74:echosure:not found
When I am executing the script it is being executed till 9th line and then the server is automatically closed.This is happening each time I am executing the script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.