08-16-2009
in unix 0 is true rest r false...am I right ???
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to check two variables and if both are blank I want to set a flag:
the_f3_pid=`rsh $target ps -ef | grep "f3.eab" | awk '{print $2}'`
the_f7_pid=`rsh $target ps -ef | grep "f7.eab" | awk '{print $2}'`
if ; then
y=1
fi
I get an error:
./script_name: test: 0403-021 ]... (4 Replies)
Discussion started by: rcarnesiii
4 Replies
2. Shell Programming and Scripting
Hi folks
I have a snippet of code Which is like this
If ( ( A || B || C ) && D ) then
Do some thing....
elif exit
fi
How to rephrase this and use it so I dont get any Errors ...
Looking out for helpful replies ..
Thanks & Regards
Srikanth GR (1 Reply)
Discussion started by: srikanthgr1
1 Replies
3. Shell Programming and Scripting
Hello,
This must be a novice question to you folks. But I searched through various places and did not find an answer to this question:
How do we perform a logical OR operation using sed command? For example, I want to write a command that extracts all the text between pattern1 and pattern2 OR... (0 Replies)
Discussion started by: thejasviv
0 Replies
4. HP-UX
hi,
i was trying to club to test condition with if.
if -o ; then
it is giving me error message, i wanted to ask how can we check two condtions with one if. (1 Reply)
Discussion started by: babom
1 Replies
5. Shell Programming and Scripting
frnds..
can i perform an OR operation in sed syntax ?
if yes.. how?
I need to search for some 2-3 mail addresses in multiple files and delete all those... and instead of them.. I need to insert a new mail id...( these are also other emails in that list .. which sud not be affected )
is... (8 Replies)
Discussion started by: clx
8 Replies
6. Shell Programming and Scripting
Hi can someone please help me on this.
I need to perform this code:
Grep any lines that meets the following criteria
(A AND B) OR (A AND C)
I tried this code, but it didn't work
Grep-I "A &&B" | "A&&C" *.* $
thanks in advance (12 Replies)
Discussion started by: Needhelp2
12 Replies
7. Programming
Hi,
Please clear the 2 questions,
2 Questions,
1) Why the new as a operator? Is there any special reason why it can't be a function like malloc?
2) How are we considering sizeof(),new are as a opearartors? I know + - * / -> , . etc.. are operators, which criteria satisfied by sizeof()... (4 Replies)
Discussion started by: Nagapandi
4 Replies
8. UNIX for Dummies Questions & Answers
All,
THe below is my script , when i use this i am getting nothing . could any one help me to know what is the use of the << operator below
su - $8 << supo
echo "exportsph $2 $1 $3 $4"
exportsph $2 $1 $3 $4
supo
i also tried as individual command su - userid << supo , when i do... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
9. Shell Programming and Scripting
I have this script to uvscan-update. Seems like that i am getting logical error at the end of the script. It is updating the script and also giving the error message to update it manually. I have deleted the DAT files to see if it will create new and it does. Below is the error and the script: ... (1 Reply)
Discussion started by: mk07md
1 Replies
10. UNIX for Dummies Questions & Answers
im new to bash scripting and im just using online tutorials and trial and error. i wanted to write a script to read numbers from a file and find their sum:
#!/bin/bash
theSum=0
for line in $(cat numbers.txt)
do
let "theSum = theSum + $line"
echo "$line"
done
echo "The sum is... (3 Replies)
Discussion started by: astrolux444
3 Replies
LEARN ABOUT DEBIAN
boolean
boolean(3pm) User Contributed Perl Documentation boolean(3pm)
NAME
boolean - Boolean support for Perl
SYNOPSIS
use boolean;
do &always if true;
do &never if false;
do &maybe if boolean($value)->isTrue;
and:
use boolean ':all';
$guess = int(rand(2)) % 2 ? true : false;
do &something if isTrue($guess);
do &something_else if isFalse($guess);
and:
use boolean -truth;
die unless ref(42 == 42) eq 'boolean';
die unless ("foo" =~ /bar/) eq '0';
DESCRIPTION
Most programming languages have a native "Boolean" data type. Perl does not.
Perl has a simple and well known Truth System. The following scalar values are false:
$false1 = undef;
$false2 = 0;
$false3 = 0.0;
$false4 = '';
$false5 = '0';
Every other scalar value is true.
This module provides basic Boolean support, by defining two special objects: "true" and "false".
RATIONALE
When sharing data between programming languages, it is important to support the same group of basic types. In Perlish programming
languages, these types include: Hash, Array, String, Number, Null and Boolean. Perl lacks native Boolean support.
Data interchange modules like YAML and JSON can now "use boolean" to encode/decode/roundtrip Boolean values.
FUNCTIONS
This module defines the following functions:
true
This function returns a scalar value which will evaluate to true. The value is a singleton object, meaning there is only one "true"
value in a Perl process at any time. You can check to see whether the value is the "true" object with the isTrue function described
below.
false
This function returns a scalar value which will evaluate to false. The value is a singleton object, meaning there is only one "false"
value in a Perl process at any time. You can check to see whether the value is the "false" object with the isFalse function described
below.
boolean($scalar)
Casts the scalar value to a boolean value. If $scalar is true, it returns "boolean::true", otherwise it returns "boolean::false".
isTrue($scalar)
Returns "boolean::true" if the scalar passed to it is the "boolean::true" object. Returns "boolean::false" otherwise.
isFalse($scalar)
Returns "boolean::true" if the scalar passed to it is the "boolean::false" object. Returns "boolean::false" otherwise.
isBoolean($scalar)
Returns "boolean::true" if the scalar passed to it is the "boolean::true" or "boolean::false" object. Returns "boolean::false"
otherwise.
METHODS
Since true and false return objects, you can call methods on them.
$boolean->isTrue
Same as isTrue($boolean).
$boolean->isFalse
Same as isFalse($boolean).
USE OPTIONS
By default this module exports the "true", "false" and "boolean" functions.
The module also defines these export tags:
:all
Exports "true", "false", "boolean", "isTrue", "isFalse", "isBoolean"
-truth
You can specify the "-truth" option to override truth operators to return "boolean" values.
use boolean -truth;
print ref("hello" eq "world"), "
";
Prints:
boolean
"-truth" can be used with the other import options.
AUTHOR
Ingy doet Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2007, 2008, 2010, 2011. Ingy doet Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
perl v5.12.4 2011-09-12 boolean(3pm)