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)
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)
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)
Hello,
Consider the following 2 arrays:
Array1 = qw(Fa0/0 Fa0/1 Fa0/2 Fa0/3);
Array1 = qw(Fa0/1 Fa0/2 Fa0/3 Fa0/4);
I want to compare the following 2 arrays as follows:
Take specific action when elements of Array1 that doesn't exist in Array2 (in my example: Fa0/0).
Take another... (4 Replies)
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)
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)
Basically, I have 2 files with IP address. For example 134.123.3.234 in the first file and 134.123.3.235 in the second. Now I want to create a file with a IP address with IP 134.123.3.236...(max 254). So i have to check files which IP address in previous two files and base on that to create a new... (10 Replies)
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)
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)
Hello everyone,
I need help comparing 2 arrays. the first array is static; the second array is not ..
array1=( "macOS Mojave" "iTunes" )
cd /Volumes
array2=( * )
# output of array2
macOS Mojave
iTunes
Mac me
The problem occurs when I compare the arrays with the following code -
... (6 Replies)
Discussion started by: trexthurman
6 Replies
LEARN ABOUT CENTOS
sctp_bindx
SCTP_BINDX(3) Linux Programmer's Manual SCTP_BINDX(3)NAME
sctp_bindx - Add or remove bind addresses on a socket.
SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>
int sctp_bindx(int sd, struct sockaddr * addrs, int addrcnt,
int flags);
DESCRIPTION
sctp_bindx adds or removes a set of bind addresses passed in the array addrs to/from the socket sd. addrcnt is the number of addresses in
the array and the flags paramater indicates if the addresses need to be added or removed.
If sd is an IPv4 socket, the addresses passed must be IPv4 addresses. If sd is an IPv6 socket, the addresses passed can be either IPv4 or
IPv6 addresses.
addrs is a pointer to an array of one or more socket addresses. Each address is contained in its appropriate structure(i.e. struct sock-
addr_in or struct sockaddr_in6). The family of the address type must be used to distinguish the address length. The caller specifies the
number of addresses in the array with addrcnt.
The flags parameter can be either SCTP_BINDX_ADD_ADDR or SCTP_BINDX_REM_ADDR. An application can use SCTP_BINDX_ADD_ADDR to associate
additional addresses with an endpoint after calling bind(2). SCTP_BINDX_REM_ADDR directs SCTP to remove the given addresses from the asso-
ciation. A caller may not remove all addresses from an association. It will fail with EINVAL.
RETURN VALUE
On success, 0 is returned. On failure, -1 is returned, and errno is set appropriately.
ERRORS
EBADF sd is not a valid descriptor.
ENOTSOCK
sd is a descriptor for a file, not a socket.
EFAULT Error while copying in or out from the user address space.
EINVAL Invalid port or address or trying to remove all addresses from an association.
EACCES The address is protected, and the user is not the super-user.
SEE ALSO sctp(7)sctp_sendmsg(3), sctp_send(3), sctp_recvmsg(3), sctp_peeloff(3), sctp_getpaddrs(3), sctp_getladdrs(3), sctp_opt_info(3), sctp_con-
nectx(3)Linux 2.6 2005-10-25 SCTP_BINDX(3)