09-12-2019
Again: DIFF is a scalar NOT an array the way you create / populate it. There is NO ${DIFF[1]}!
Wouldn't it be better to show the big picture of your problem, so a tailored solution can be found? What are you after, in the end?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want a soultion to compare two arrays in sh with an easy way.I want a solution to synchrose users between different AIX servers where no NIS is available. All users are meant to be same on all 10 servers. So the approach is to consider first server as master user repository and whatever the users... (0 Replies)
Discussion started by: rijeshpp
0 Replies
2. Shell Programming and Scripting
Hello,
Let's say that we have the two following arrays
@array1=
@array2=
Is there any easy way to compare these two arrays and print the values that exist in array1 and not in array2 and the values that exist in array2 and not in array1?
Regards,
Chriss_58 (3 Replies)
Discussion started by: chriss_58
3 Replies
3. Shell Programming and Scripting
Hi Im supposed to compare lines in a file :
KB0005 1019 T IFVATVPVI 0.691 PKC YES
KB0005 1036 T YFLQTSQQL 0.785 PKC YES
KB0005 1037 S FLQTSQQLK 0.585 DNAPK YES
KB0005 1045 S KQLESEGRS 0.669 PKC YES
KB0005 1045 S KQLESEGRS 0.880 unsp YES
KB204320 1019 T IFVATVPVI 0.699 PKC YES
... (7 Replies)
Discussion started by: karla
7 Replies
4. Shell Programming and Scripting
I have two arrays I need to compare against a third, looking for matches, not differences. I think I'm going to have to convert the arrays to files and grep them, but I'm not too sure if there's a tool to enable me to matches specifically, instead of differences.
Thanks in advance!
Karl (9 Replies)
Discussion started by: karlp
9 Replies
5. Shell Programming and Scripting
Hi,
my first post here!
Description of my problem:
I have one txt-file with six rows and each row contains seven numbers seperated with whitespaces.
I want to:
Compare one array with seven numbers with each row of numbers in the txt-file.
I have managed to compare one array with... (6 Replies)
Discussion started by: mjoh
6 Replies
6. Shell Programming and Scripting
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)
Discussion started by: kristinu
41 Replies
7. Shell Programming and Scripting
I've been trying to have an array of ip addresses go through a loop one at a time. Then compare if the current element is in another array of ip addresses. I've traced my error with /bin/bash -x
+ for c in '"${ip}"'
./netk5: line 65: 50.17.231.23 23.64.146.110 23.64.159.139 107.14.36.129... (17 Replies)
Discussion started by: Azrael
17 Replies
8. Shell Programming and Scripting
Hi,
I am trying to compare two lists that are held in two variables so I believe I need to access the array elements to compare these. I am using ksh 88 and the code I have tried is below:
for file in ${origfilelist}
do
if ]]
then
print -- "File ${file}... (3 Replies)
Discussion started by: frodo61
3 Replies
9. Shell Programming and Scripting
I have two arrays and they look like this:
array=(`cat /local/mnt/*sys/*includes|grep -v NEW`)
array2=(`cat /tmp/*sys.z |grep -v NEW`)
I am trying to compare them but I need to use the diff -u command. I am not sure how to do this. I cannot just do diff -u ${array} ${array2}
I cannot... (4 Replies)
Discussion started by: newbie2010
4 Replies
10. Shell Programming and Scripting
I have 2 arrays of values for example
A1 ={10 15 3 21}
A2 ={10 15 3 22}
I need to check which one has greater values. However:
A1 ={10 15 3 21}
A2 ={10 15 3 21 3} - this one would be greater.
A1 ={10 15 5 21} - this one greater
A2 ={10 15 3 21}
Basically, I want to compare patch... (6 Replies)
Discussion started by: Jutsimitsu
6 Replies
LEARN ABOUT DEBIAN
pdl::gsl::diff
DIFF(3pm) User Contributed Perl Documentation DIFF(3pm)
NAME
PDL::GSL::DIFF - PDL interface to numerical differentiation routines in GSL
DESCRIPTION
This is an interface to the numerical differentiation package present in the GNU Scientific Library.
SYNOPSIS
use PDL;
use PDL::GSL::DIFF;
my $x0 = 3.3;
my @res = gsldiff(&myfunction,$x0);
# same as above:
@res = gsldiff(&myfunction,$x0,{Method => 'central'});
# use only values greater than $x0 to get the derivative
@res = gsldiff(&myfunction,$x0,{Method => 'forward'});
# use only values smaller than $x0 to get the derivative
@res = gsldiff(&myfunction,$x0,{Method => 'backward'});
sub myfunction{
my ($x) = @_;
return $x**2;
}
FUNCTIONS
gsldiff()
This functions serves as an interface to the three differentiation functions present in GSL: gsl_diff_central, gsl_diff_backward and
gsl_diff_forward. To compute the derivative, the central method uses values greater and smaller than the point at which the derivative is
to be evaluated, while backward and forward use only values smaller and greater respectively. gsldiff() returns both the derivative and an
absolute error estimate. The default method is 'central', others can be specified by passing an option.
Please check the GSL documentation for more information.
Usage:
($d,$abserr) = gsldiff($function_ref,$x,{Method => $method});
Example:
#derivative using default method ('central')
($d,$abserr) = gsldiff(&myf,3.3);
#same as above with method set explicitly
($d,$abserr) = gsldiff(&myf,3.3,{Method => 'central'});
#using backward & forward methods
($d,$abserr) = gsldiff(&myf,3.3,{Method => 'backward'});
($d,$abserr) = gsldiff(&myf,3.3,{Method => 'forward'});
sub myf{
my ($x) = @_;
return exp($x);
}
BUGS
Feedback is welcome. Log bugs in the PDL bug database (the database is always linked from <http://pdl.perl.org>).
SEE ALSO
PDL
The GSL documentation is online at
http://sources.redhat.com/gsl/ref/gsl-ref_toc.html
AUTHOR
This file copyright (C) 2003 Andres Jordan <andresj@physics.rutgers.edu> All rights reserved. There is no warranty. You are allowed to
redistribute this software documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file
is separated from the PDL distribution, the copyright notice should be included in the file.
The GSL differentiation routines were written by David Morrison.
FUNCTIONS
diff_central
Signature: (double x(); double [o] res(); double [o] abserr(); SV* funcion)
info not available
diff_central does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input
piddles.
diff_backward
Signature: (double x(); double [o] res(); double [o] abserr(); SV* funcion)
info not available
diff_backward does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input
piddles.
diff_forward
Signature: (double x(); double [o] res(); double [o] abserr(); SV* funcion)
info not available
diff_forward does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input
piddles.
perl v5.14.2 2012-05-30 DIFF(3pm)