LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-31-2011, 03:40 PM   #1
dexter126
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
String comparison error


Here's my code on SLES v11.

#! /usr/bin/ksh

MQSILIST=$(mqsilist)
RUNNING="BIP1284I: Broker 'BRK1E' on queue manager 'BRK1QME' is running. BIP8071I: Successful command completion."

echo $MQSILIST
if ["$MQSILIST" == "$RUNNING"]; then
echo "Running."
fi

Here's the error I receive.
user@host:~/scripts> ./check_BRK1E.sh
BIP1284I: Broker 'BRK1E' on queue manager 'BRK1QME' is running. BIP8071I: Successful command completion.
./check_BRK1E.sh[8]: [BIP1284I: Broker 'BRK1E' on queue manager 'BRK1QME' is running.
BIP8071I: Successful command completion.: not found [No such file or directory]

Any suggestions?
 
Old 01-31-2011, 05:03 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Try adding spaces. [ is a command that takes ] as its last argument, not syntactic sugar.

Code:
if [ "$MQSILIST" == "$RUNNING" ]
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
string comparison in bash davimint Programming 4 01-23-2008 06:36 PM
String Comparison gjagadish Programming 6 11-06-2007 03:34 AM
String comparison in while [ ... ] condition hiwa Linux - Software 3 05-27-2007 02:05 AM
String comparison algorithm MicahCarrick Programming 4 04-11-2006 01:26 AM
bash string comparison noir911 Programming 1 01-25-2006 06:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:16 PM.

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