Not really, you could avoid using the j and check for
I don't think that there is any other way to get the sum of structure elements. Maybe you could declare them in an array and use a loop to get the sum? If not, then you have no choice but to go about it this way.
Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it.
To make a long story short around 20K pieces of... (2 Replies)
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Hi
I am trying to add variables(float values) in a unix script but am getting an error
value=`expr $a + $b + $c`
The error I am getting is "expr: non-numeric argument"
I guess it has got to something with the decimal points.
Plz help (13 Replies)
Hi there
If I run a 'swap -l' on my solaris box, i get
swapfile dev swaplo blocks free
/dev/dsk/c1t0d0s1 54,65 8 67119560 65655144
/dev/dsk/c1t0d0s2 54,65 8 33119522 32655122
I wanted to run a for loop adding up the totals of each column 4 , excluding the... (2 Replies)
I have 3 variables with different information.. they look like this (row-wise aswell):
Variable1 =
Roland
Kalle
Dalius
Variable2 =
ake123
ler321
kaf434
Variable3 =
Richardsen
Sworden
Lokthar
How can I sort them by variable3 alphabetical and add them into the same output so... (0 Replies)
Hi.
I have a for loop that I use to extract integer values in a shell script (ksh). Now, I would like to add the values. My preference, from my c programming days, would be to do something like the commented out line below in the for loop. However, this is not recognised. So I use the line... (2 Replies)
I have a script below that goes to the given directory and plays the newest powerpoint presentation via powerpoint viewer and wine.
So far it works perfectly but now Id like to add a while statement to essentially run find /ticker/powerpointshare -mmin -1 -type f -iname "*.ppt" and if it finds a... (9 Replies)
Hello,
I want to add a letter to the end of a string if it repeats in a column.
so if I have a file like this:
DOG001
DOG0023
DOG004
DOG001
DOG0023
DOG001
the output should look like this:
DOG001-a
DOG0023-a
DOG004
DOG001-b (15 Replies)
So, I have this command:
mkdir rolled
for %%x in (*gif) do convert %%x -roll +2+6 %%x|move %%x rolled
I'd like to have the +2 and +6 accumulate here.
In each new gif tackled, it should increase by the amount: +2 (for x) and +6 (for y)
Is this possible?
I'm on Windows, DOS. (0 Replies)
Discussion started by: pasc
0 Replies
LEARN ABOUT DEBIAN
netsds::util::types
NetSDS::Util::Types(3pm) User Contributed Perl Documentation NetSDS::Util::Types(3pm)NAME
NetSDS::Util::Types - type checking routines
SYNOPSIS
use NetSDS::Util::Types;
# Check if variable contains integer value
if (is_int($var)) {
$var++;
} else {
print "Value is not integer!";
}
DESCRIPTION
"NetSDS::Util::Types" module contains functions for checking data for being of exact data types.
EXPORTED FUNCTIONS
is_int($var) - check if parameter is integer
Check if given parameter is integer
is_float([...]) - check if parameter is float number
Check if given parameter is float number
is_date([...]) - check if parameter is date string
Return 1 if parameter is date string
is_binary([...]) - check for binary content
Return 1 if parameter is non text.
is_ref_scalar($ref) - check if reference to scalar value
Return true if parameter is a scalar reference.
my $var = 'Scalar string';
if (is_ref_scalar($var)) {
print "It's scalar value";
}
is_ref_array($ref) - check if reference to array
Return true if parameter is an array reference.
is_ref_hash($ref) - check if hashref
Return true if parameter is a hash reference.
is_ref_code($ref) - check if code reference
Return true if parameter is a code reference.
is_ref_obj($ref, [$class_name]) - check if blessed object
Return true if parameter is an object.
EXAMPLES
None
BUGS
None
TODO
Add more functions.
SEE ALSO
None.
AUTHORS
Valentyn Solomko <pere@pere.org.ua>
Michael Bochkaryov <misha@rattler.kiev.ua>
perl v5.12.4 2011-08-27 NetSDS::Util::Types(3pm)