Sponsored Content
Top Forums Shell Programming and Scripting check the difference between 2 array Post 302594078 by drl on Monday 30th of January 2012 11:05:32 AM
Old 01-30-2012
Hi.

See also check the difference between 2 arrays

Best wishes ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Array Difference Sun Vs Linux

Hi All, I have a script in which an array is defined. when i run that on Linux box its fine but when i run on SunOS its points to the line where array is defined as below : syntax error at line 9 : `(' unexpected array defined as ID=( ~Hog ~Todd ~Mike ) Thanks in advance (0 Replies)
Discussion started by: ravi.sadani19
0 Replies

2. Shell Programming and Scripting

Help! Yet another check element in array Question

Greetings, DISCLAIMER: My shell scripting is rusty so my question may be borderline stupid. You've been warned. I need to create a script that a) lists the content of zip files in a directory and b) sends out an `exception` report. My ZIP files contain a control file (for load check). I want... (2 Replies)
Discussion started by: alan
2 Replies

3. UNIX for Dummies Questions & Answers

Check for difference in output of 2 commands?

Hello! I'm just learning the shell, and I would really like to know how to do this: Given these 2 commands: ls -l ls -le How can I, with a one-liner, ask the shell to show me visually in the shell, what the difference is between the output of the two commands? They look the same to me... (6 Replies)
Discussion started by: turbofayce
6 Replies

4. Shell Programming and Scripting

Comparing date and check minute difference

Dear all, I'm stuck on Solaris 9 bash (I believe is quite different from Linux system) trying to find a solution. I have one file named like:120629-1750-TERZ81_AS_YTR.txt YYMMDD-HH-MM-......The script should compare the actual date with the one reported on the file name and then take an action... (4 Replies)
Discussion started by: Lord Spectre
4 Replies

5. Red Hat

How to check for values in array?

i stored some values in array , then i traverse through the array and check for some values and if they exist then echo success. let us consider that in our array we stored values from an sql query like this #!/bin/bash declare -a arr arr=$( sqlplus -s rte/rted2@rel76d2 << EOF set... (1 Reply)
Discussion started by: ramsavi
1 Replies

6. UNIX for Dummies Questions & Answers

ksh to check second time difference between two servers

I am currently setting up a public key authentication between servers. The goal is to get the date via `ssh hostname date` on all the 4 remote servers , put the value in a text file on the central server and compare the date (specifically seconds) for each server date output to check if time is... (7 Replies)
Discussion started by: depam
7 Replies

7. Shell Programming and Scripting

Check/Parse log file's lines using time difference/timestamp

I was looking at this script which outputs the two lines which differs less than one sec. #!/usr/bin/perl -w use strict; use warnings; use Time::Local; use constant SEC_MILIC => 1000; my $file='infile'; ## Open for reading argument file. open my $fh, "<", $file or die "Cannot... (1 Reply)
Discussion started by: cele_82
1 Replies

8. Shell Programming and Scripting

Finding difference in between two array's of strings

Hi, Can anybody help me in finding the difference between two array elements with the help of code pls. purge=("Purge Concurrent Request and/or Manager Data" "Purge Signon Audit data" "Purge Obsolete Workflow Runtime Data" "Purge Logs and Closed System Alerts") purge_1=("Purge Obsolete... (3 Replies)
Discussion started by: Y.balakrishna
3 Replies

9. Shell Programming and Scripting

How to get difference of two array?

Required Unix shell script which will identify the difference of String2 based on string1. I am facing this issue and unable to achieve the result. String1= {1 3 lok kam} String2= {3 kam 5} Result should be like below: Data is matching for: 3 Data is matching for: kam Data is not matching... (7 Replies)
Discussion started by: lokendrasb
7 Replies

10. Programming

Array Elements Check

Hi everyone, :) I'm trying to make a simple C program that scans an array of chars to see if its elements are similar. I can't understand what's wrong. Could you help me to fix this? Here is the code. Thanks! #include<stdio.h> int main() { int arr; int i, len; int flag =... (10 Replies)
Discussion started by: IgorGest
10 Replies
ARRAY_UINTERSECT_UASSOC(3)						 1						ARRAY_UINTERSECT_UASSOC(3)

array_uintersect_uassoc  -  Computes  the intersection of arrays with additional index check, compares data and indexes by separate callback func-
tions

SYNOPSIS
array array_uintersect_uassoc (array $array1, array $array2, [array $...], callable $value_compare_func, callable $key_compare_func) DESCRIPTION
Computes the intersection of arrays with additional index check, compares data and indexes by separate callback functions. PARAMETERS
o $array1 - The first array. o $array2 - The second array. o $value_compare_func - The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. int callback (mixed $a, mixed $b) o $key_compare_func - Key comparison callback function. RETURN VALUES
Returns an array containing all the values of $array1 that are present in all the arguments. EXAMPLES
Example #1 array_uintersect_uassoc(3) example <?php $array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red"); $array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red"); print_r(array_uintersect_uassoc($array1, $array2, "strcasecmp", "strcasecmp")); ?> The above example will output: Array ( [a] => green [b] => brown ) SEE ALSO
array_uintersect(3), array_intersect_assoc(3), array_intersect_uassoc(3), array_uintersect_assoc(3). PHP Documentation Group ARRAY_UINTERSECT_UASSOC(3)
All times are GMT -4. The time now is 01:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy