true(1) User Commands true(1)NAME
true, false - provide truth values
SYNOPSIS
true
false
DESCRIPTION
The true utility does nothing, successfully. The false utility does nothing, unsuccessfully. They are typically used in a shell script sh
as:
while true
do
command
done
which executes command forever.
EXIT STATUS
true has exit status 0.
false always will exit with a non-zero value.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO sh(1), attributes(5), standards(5)SunOS 5.11 1 Feb 1995 true(1)
Check Out this Related Man Page
BOOLVAL(3) 1 BOOLVAL(3)boolval - Get the boolean value of a variableSYNOPSIS
boolean boolval (mixed $var)
DESCRIPTION
Returns the boolean value of $var.
PARAMETERS
o $var
- The scalar value being converted to a boolean.
RETURN VALUES
The boolean value of $var.
EXAMPLES
Example #1
boolval(3) examples
<?php
echo '0: '.(boolval(0) ? 'true' : 'false')."
";
echo '42: '.(boolval(42) ? 'true' : 'false')."
";
echo '0.0: '.(boolval(0.0) ? 'true' : 'false')."
";
echo '4.2: '.(boolval(4.2) ? 'true' : 'false')."
";
echo '"": '.(boolval("") ? 'true' : 'false')."
";
echo '"string": '.(boolval("string") ? 'true' : 'false')."
";
echo '"0": '.(boolval("0") ? 'true' : 'false')."
";
echo '"1": '.(boolval("1") ? 'true' : 'false')."
";
echo '[1, 2]: '.(boolval([1, 2]) ? 'true' : 'false')."
";
echo '[]: '.(boolval([]) ? 'true' : 'false')."
";
echo 'stdClass: '.(boolval(new stdClass) ? 'true' : 'false')."
";
?>
The above example will output:
0: false
42: true
0.0: false
4.2: true
"": false
"string": true
"0": false
"1": true
[1, 2]: true
[]: false
stdClass: true
SEE ALSO floatval(3), intval(3), strval(3), settype(3), is_bool(3), Type juggling.
PHP Documentation Group BOOLVAL(3)
Hi there
I'm hoping one of the expert unix guys or gals can assist me in understanding the language within scripts
e.g
clear
while true
do
tput cup 0 0
LIST=`grep cisco /etc/hosts|grep -v _int | awk '{print $2}'`
for SITE in $LIST
do
IP=`grep "$SITE"... (4 Replies)
i want to delete every newline and every line which starts with "RECORD......." in a file.
FILE:
Record 61391 in base BROCKHAUS (Timestamp: 2008-04-09 11:38:38)
UNTERTITEL :
Gräfin (seit 1707 Reichsgräfin) von, * Schwerin 4. 2. 1686, + Berlin
21. 10. 1744; wurde
Record 61392 in base BROCKHAUS... (4 Replies)
Hi,
I'm new to UNIX and am trying to learn shell scripting in order to work on an interface that I inherited when a co-worker left. I need to be able to check to see whether a file exists to determine whether the FTP has taken place, but in testing, the if statement always evaluates as false,... (3 Replies)
Hi all,
If anyone has the explanation for the following issue, please share it with me.
I am comparing two variable a and b with the values of 007 and 7, for these values it get evaluated as True. For a=008 and b=8, for these values it get evaluated as false.
#!/bin/tclsh
set a 007 ... (3 Replies)
Hi Experts,
I am using Solaris-10, Sun-Fire-V445.
i got often the below message-
"Memory Usage – Critical, Memory usage (RAM) exceeding 90%
The memory utilization is exceeding 90%" in a application running on solaris.
I checked with Vmstat. Everything seems to be fine. Where i should... (5 Replies)
Just started with learning python and tried something, most people here would call more than simple.
I just wanted to list all directories within my main directory. So I user the following code:
#!/usr/bin/env python
import os
if os.path.isdir("/home/testaccaunt/public_html"):
... (8 Replies)
I'm using clustered zones on my machine. i'm only at the test phase of my design and ultimately the oracle zones will be using VxVM.
When the testing phase is complete, VxVM will be used in the containers. It is necessary for VxVM to run in the global zone for the containers to use it (is... (5 Replies)
Hello All,
Nagios seems to be sending false alerts about few hosts, (ex: There were no users on one host and still Nagios was reporting a critical alert and says 6 users are logged in. How do I fix this one?
Also, I have installed nagios and added 12 hosts as a start and monitoring few... (4 Replies)
hi Alll,
I want to install solaris 10 on exixting solaris mahcine.
I tried for OK boot cdrom-install
but it gave me fatal error - disk not bootable , boot command disable
so i tried with
ok setenv auto-boot? false
Ok reset-all
after this server rebooted automatically and... (2 Replies)
Hi Experts,
I was looking at the below link, for finding words next to it, And unable to understand this syntax:
Can any one please explain , what is meaning of this code:
if ( F )
s = s ? s OFS $i : $i
from:... (4 Replies)
Heyas
As there was a splitting issue with TUI 0.6.6-x focused around tui-status since the 'solaris' (not really but for that purpose) update, the urge was given to do this first.
Well, the splitting 'bug' should be fixed, i hope.
But i've found a new one.
When i start the very same script... (4 Replies)
I have this code that sometimes return a false value and the code inside the if statement gets executed and error out. Any idea why? thanks.
So I set a debug and see what the value for $ScriptElapsedTime
Here is the value I got ScriptElapsedTime='03:20'. Base on this value the if... (10 Replies)
Hi All,
I'm trying to come up a way to check the output of some data i have. I need to be able to check for the order of the output and if its correct set a variable to false if it isnt.
Currently the data is in the below format, this is the value which should cause the variable be set... (4 Replies)
Hi
I have written a script to send email alerts when load of my linux server reaches max point
I keep getting false emails thought the load is normal , looks like same email is generated again and again - called from cron tab
checked if the tempfile is present , no it is not , cleaned... (22 Replies)
Hi All
Below code is working as expected but creating too many child processes when the url is not up and every minute that process is sending false email alerts
any help with the logic not to generate child process and not to send duplicate alerts
app="https://url"
appresult=$(wget... (2 Replies)