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.10 1 Feb 1995 true(1)
Check Out this Related Man Page
if(1T) Tcl Built-In Commands if(1T)__________________________________________________________________________________________________________________________________________________NAME
if - Execute scripts conditionally
SYNOPSIS
if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
_________________________________________________________________DESCRIPTION
The if command evaluates expr1 as an expression (in the same way that expr evaluates its argument). The value of the expression must be a
boolean (a numeric value, where 0 is false and anything is true, or a string value such as true or yes for true and false or no for false);
if it is true then body1 is executed by passing it to the Tcl interpreter. Otherwise expr2 is evaluated as an expression and if it is true
then body2 is executed, and so on. If none of the expressions evaluates to true then bodyN is executed. The then and else arguments are
optional ``noise words'' to make the command easier to read. There may be any number of elseif clauses, including zero. BodyN may also be
omitted as long as else is omitted too. The return value from the command is the result of the body script that was executed, or an empty
string if none of the expressions was non-zero and there was no bodyN.
EXAMPLES
A simple conditional:
if {$vbl == 1} { puts "vbl is one" }
With an else-clause:
if {$vbl == 1} {
puts "vbl is one"
} else {
puts "vbl is not one"
}
With an elseif-clause too:
if {$vbl == 1} {
puts "vbl is one"
} elseif {$vbl == 2} {
puts "vbl is two"
} else {
puts "vbl is not one or two"
}
Remember, expressions can be multi-line, but in that case it can be a good idea to use the optional then keyword for clarity:
if {
$vbl == 1 || $vbl == 2 || $vbl == 3
} then {
puts "vbl is one, two or three"
}
SEE ALSO expr(1T), for(1T), foreach(1T)KEYWORDS
boolean, conditional, else, false, if, true
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tclif(1T)
I'm running Digital Unix True64 system. version4.0. My CDE is shutoff. How can I start the CDE. When I boot my system I don't even get graphic startup picture in the beginn. I've tried to activate thourgh Graphical UI Selection Facility in /usr/sbin/setup.But all I have is alot of inactive... (12 Replies)
Hi guys,
I'm new to unix but loving it!! BUT this is driving me nuts as i can't work out the best way to do it.
I have a while true loop that i use to monitor something. For my own reasons in ths script i have disabled the CTRL C using the trap command. But i want to put in a option to exit... (5 Replies)
Hi All,
i have an input below.
As long as "x= 1" , i would want to capture 2 lines using sed or awk
for eg :
0001 x= 1 $---------------------------------..-.--..
0001 tt= 137 171 423 1682 2826 0
Pls help. Thanks in advance.
Note that the number of lines in each block do... (37 Replies)
Hallo everybody
I am having a shell script called auto_run.sh in that only the first line works.
the second line which has sed command is working only at the # prompt. not within the shell script. What could be the reason.
*... sed 's/ //g' KTI >abc works in another shell script without the... (6 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)
I have the following code and for some reason when I call the program using
/home/tcdata/tatsh/trunk/hstmy/bin/bash/raytrac.bash --cmod=jcdint.cmod
I get
hasArgument =
hasArgument = true
Somehow the array element is returning even though I have not chosen the option.
... (41 Replies)
Okay, I need some nerd magic here! LOL!
Using a bash script, I have a folder that I'd like to remove upon uninstalling a package. That part is simple but what isn't simple is taking into consideration a 'reinstall' or 'upgrade' of that same package.
By default, 'reinstalling' or 'upgrading'... (8 Replies)
Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space.
Total length of record is 420. Here is the specification of the data in file.
Position Field Data Type... (5 Replies)
I'm extremely new to shell scripting so I apologize for the crudeness of my descriptions. I am editing a script that will write files (e.g. Job0_A.com, Job1_A.com, etc.) and then run them through a program called gaussian (computational chemistry program). The script will then take the output files... (10 Replies)
I am having trouble getting mailx to send multiple Bcc mails out without everyone in the list of recipients seeing everyone else's email addresses. I looked at the man pages of my system and seem to be following the syntax correctly, but the mails still go out as if I were just putting in a list of... (7 Replies)
Hi,
I have the following txt file List_With_Duplicates.txt;
a,1,1
b,3,4
c,5,2
d,6,1
e,3,3
f,3,7
When I run the command
awk -F ',' '{if($2==$3){print $1","$2","$3}}' List_With_Duplicates.txt I get the following output;
a,1,1
e,3,3
This works! as I've compared the 2nd & 3rd... (7 Replies)
Hi everyone
I just got my hands on a T5120 running Sol10. As far as I've read, the T2 chip has a built-in hardware number generator. My question is: how can I access it to get random numbers in either C or Fortran? I'm using Sun Studio 12.4.
I am currently trying to write an... (13 Replies)
Hello,
This is a bit complicated for me.
My scenario in MyFile:
Search string1,
When string1 is found, grep the line containing string1, go back over that line in upward direction and grep the first line containing string2.
Here is an example:
MyFile
His email address... (17 Replies)
I have a csv file as given below,
org1 org2 org3 org4 org5
gene1 100 80 90 80 150
gene2 30 70 50 50 115
gene3 40 120 60 40 105
gene4 20 72 40 60 20
I need to replace the fields are having values greater than 100 with "TRUE". I used the following commands to replace... (6 Replies)