Hi guys, I'm trying to run more than one "if" condition at once. What I want is something like
if ] or ] or ]; then
...
I can't remember the syntax for using this or/and set operators. Can someone please assist/ jog my memory?
thanks
Khoom (2 Replies)
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Hi All,
I have 2 variables. Result1 and Result2. I want to put a condition that if Both are True then echo "All True" Else Show Error.
Right now i am doing this and getting error.
if ;
then
echo "All True"
else
echo "Failed"
fi;
Error.
line 8: '
Solution: Looking for (2 Replies)
I really don't know the meaning of these operators. Could someone explain the meanings so I can make my test for today?
<, <=, ==, !=, >=, >,
||, &&, ! ~ , !~
Thanks! (1 Reply)
I do not know the use of the -o -v -R operators.
This is what the info says and I am confused of what optname and varname
mean, are they just normal variable?
-o optname
True if the shell option optname is enabled. See the list of
options under the ... (6 Replies)
Discussion started by: kristinu
6 Replies
LEARN ABOUT DEBIAN
bbcombotest.cfg
BBCOMBOTEST.CFG(5) File Formats Manual BBCOMBOTEST.CFG(5)NAME
bbcombotest.cfg - Configuration of bbcombotest tool
SYNOPSIS
$BBHOME/etc/bbcombotest.cfg
DESCRIPTION bbcombotest(1) uses it's own configuration file, $BBHOME/etc/bbcombotest.cfg Each line in this file defines a combined test.
FILE FORMAT
Each line of the file defines a new combined test. Blank lines and lines starting with a hash mark (#) are treated as comments and ignored.
The configuration file uses the hostnames and testnames that are already used in your Xymon bb-hosts file. These are then combined using
normal logical operators - "||" for "or", "&&" for "and" etc.
A simple test - e.g. "Web1.http" - results in the value "1" if the "http" test for server "Web1" is green, yellow or clear. It yields the
value "0" if it is red, purple or blue.
Apart from the logical operations, you can also do integer arithmetic and comparisons. E.g. the following is valid:
WebCluster.http = (Web1.http + Web2.http + Web3.http) >= 2
This test is green if two or more of the http tests for Web1, Web2 and Web3 are green.
The full range of operators are:
+ Add
- Subtract
* Multiply
/ Divide
% Modulo
| Bit-wise "or"
& Bit-wise "and"
|| Logical "or"
&& Logical "and"
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
== Equal
There is currently no support for a "not" operator. If you need it, use the transcription "(host.test == 0)" instead of "!host.test".
NB: All operators have EQUAL PRECEDENCE. If you need something evaluated in a specific order, use parentheses to group the expressions
together.
If the expression comes out as "0", the combined test goes red. If it comes out as non-zero, the combined test is green.
Note: If the expression involves hostnames with a character that is also an operator - e.g. if you have a host "t1-router-newyork.foo.com"
with a dash in the hostname - then the operator-character must be escaped with a backslash '' in the expression, or it will be interpreted
as an operator. E.g. like this:
nyc.conn = (t1-router-nyc.conn || backup-router-nyc.conn)
EXAMPLE
WebCluster.http = (Web1.http || Web2.http)
AppSrvCluster.procs = (AppSrv1.conn && AppSrv1.procs) || (AppSrv2.conn && AppSrv2.procs)
Customer.cluster = WebCluster.http && AppSrvCluster.procs
The first line defines a new test, with hostname "WebCluster" and the columnname "http". It will be green if the http test on either the
"Web1" or the "Web2" server is green.
The second line defines a "procs" test for the "AppSrvCluster" host. Each of the AppSrv1 and AppSrv2 hosts is checked for "conn" (ping)
and their "procs" test. On each host, both of these must be green, but the combined test is green if that condition is fulfilled on just
one of the hosts.
The third line uses the two first tests to build a "double combined" test, defining a test that shows the overall health of the system.
FILES
$BBHOME/etc/bbcombotest.cfg
SEE ALSO bbcombotest(1)Xymon Version 4.2.3: 4 Feb 2009 BBCOMBOTEST.CFG(5)