09-13-2018
That is awesome. It will probably be later tonight before I have time to test and merge that with what I've got. I'll update here later when I've had time to try that out and make sure I'm not still lost.
Wanted to say thank you again. Especially to Corona688, RudyC and other long time members. With a name like unix.com I would expect more learning about OS Administration, which this site has too. At the same time I've learned more about C here than on some of the bigger dev forums that only do dev stuff.
I'll update this soon once I get time to test this
EDIT: Following the last method did work.
Last edited by Azrael; 09-15-2018 at 11:05 AM..
Reason: Update, Closing
This User Gave Thanks to Azrael For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to assign an array as a value to one of the array element, I mean
I have an array @KS and array @kr.
I want array @KS to hold @kr as an element.
So I am doin this
$KS=@kr;
But the value stored is number of elements in the @kr array.
Can... (2 Replies)
Discussion started by: eamani_sun
2 Replies
2. Shell Programming and Scripting
Suppose there are two arrays of arrays:
@A = ( , , , );
@B = ( , , , , );
For each of $A, $A, $A..., I want to find the corresponding one in @B (match the letter, like $A eq $B), and print out both the second item, for example, $A and $B.
How can I do this in perl? grep + map? Hope I... (1 Reply)
Discussion started by: zx1106
1 Replies
3. Shell Programming and Scripting
PHP question...I posted this on the Web Development forum, but maybe this is a better place!
I have an SQL query that's pulled back user IDs as a set of columns. Rather than IDs, I want to use their names.
So I have an array of columns $col with values 1,7,3,12 etc and I've got an array $person... (3 Replies)
Discussion started by: JerryHone
3 Replies
4. Programming
Hi All
I need to get <STDIN> from a user. the <STDIN> is a range of number delimited by "," (comma) and can be with range delimited by "-".
Example: 1,2,3,4-9,12,15,34-36,70
Now I need to get this from the user and go on each number and "Do something"... but when trying to do this as above... (2 Replies)
Discussion started by: RedGrinGo
2 Replies
5. Shell Programming and Scripting
I have 2 arrays:
@array1 outputs the following:
1
1
1
2
@array2 outputs the following
A
B
C
D (2 Replies)
Discussion started by: streetfighter2
2 Replies
6. Shell Programming and Scripting
here is what i have...
i=1
while read line
do
if grep -i-q "create procedure"<<<$line
then
startline="$line"
endline="blahblah"
Get procedure name into a variable named procName
procName="procedure name is stored"
do some... (2 Replies)
Discussion started by: vivek d r
2 Replies
7. Shell Programming and Scripting
hello,
i need a bit of help on how to do this effectively in bash without a lot of extra looping or massive switch/case
i have a long array of M elements and a short array of N elements, so M > N always. M is not a multiple of N.
for case 1, I want to stretch N to fit M
arrayHuge
H = (... (2 Replies)
Discussion started by: f77hack
2 Replies
8. Programming
I hate I'm asking for help again. Unfortunately it seems there just aren't any links I can find on making an array that holds a bunch of two dimensional arrays. Maybe my google-fu is lacking. Basically I have a header file like this:
#define MATRIX 10
int white_l1;
int white_l2;
int... (2 Replies)
Discussion started by: Azrael
2 Replies
9. Programming
Le sigh... Hopefully this will be the last time I have to ask for help on this topic. For a while now I've been working with a 1d array that holds 2d arrays. For reference you can view here. Now I'm just trying to loop through the elements with the following:
#include <stdio.h>
void... (3 Replies)
Discussion started by: Azrael
3 Replies
10. UNIX for Beginners Questions & Answers
So I need to Write an array processing program using a Linux shell programming language to perform the following.
Load array X of 20 numbers from an input file X.
Load array Y of 20 numbers from an input file Y.
Compute array Z by multiply Xi * Yi then compute the square-root of this... (2 Replies)
Discussion started by: sarapham409
2 Replies
LEARN ABOUT PHP
array_diff_key
ARRAY_DIFF_KEY(3) 1 ARRAY_DIFF_KEY(3)
array_diff_key - Computes the difference of arrays using keys for comparison
SYNOPSIS
array array_diff_key (array $array1, array $array2, [array $...])
DESCRIPTION
Compares the keys from $array1 against the keys from $array2 and returns the difference. This function is like array_diff(3) except the
comparison is done on the keys instead of the values.
PARAMETERS
o $array1
- The array to compare from
o $array2
- An array to compare against
o $...
- More arrays to compare against
RETURN VALUES
Returns an array containing all the entries from $array1 whose keys are not present in any of the other arrays.
EXAMPLES
Example #1
array_diff_key(3) example
The two keys from the key => value pairs are considered equal only if (string) $key1 === (string) $key2 . In other words a strict
type check is executed so the string representation must be the same.
<?php
$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
var_dump(array_diff_key($array1, $array2));
?>
The above example will output:
array(2) {
["red"]=>
int(2)
["purple"]=>
int(4)
}
NOTES
Note
This function only checks one dimension of a n-dimensional array. Of course you can check deeper dimensions by using
array_diff_key($array1[0], $array2[0]);.
SEE ALSO
array_diff(3), array_udiff(3), array_diff_assoc(3), array_diff_uassoc(3), array_udiff_assoc(3), array_udiff_uassoc(3), array_diff_ukey(3),
array_intersect(3), array_intersect_assoc(3), array_intersect_uassoc(3), array_intersect_key(3), array_intersect_ukey(3).
PHP Documentation Group ARRAY_DIFF_KEY(3)