LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-23-2007, 05:05 AM   #1
151803
LQ Newbie
 
Registered: Jan 2007
Posts: 22

Rep: Reputation: 15
Linux scripting


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

Thanks in advance
 
Old 02-23-2007, 05:15 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you can't even give us a line number??
 
Old 02-23-2007, 06:16 AM   #3
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 38
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?
 
Old 02-23-2007, 09:11 AM   #4
151803
LQ Newbie
 
Registered: Jan 2007
Posts: 22

Original Poster
Rep: Reputation: 15
Linux scripting

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.

Please advice what does the error imply
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
linux scripting redhatbeatswin Linux - Newbie 2 11-15-2004 01:02 PM
Scripting in Linux Rv5 Programming 2 09-05-2004 10:14 PM
Linux scripting Cybercool Linux - Newbie 5 04-16-2004 01:57 AM
Scripting in Linux Phantom Linux - Newbie 1 11-07-2001 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration