Not sure if this is possible, but I've tried this about a thousand ways now. I am making something with a lot of arrays. I thought I could put the array names into a separate array and then loop through them to call all of their elements. This is the best I've got so far:
From it I get the following error:
Oddly enough it still runs despite the error:
Seems its not incrementing on the first loop with c. I've tried changing ++c to c++, casting, etc, but no change. Anyone know if this is not possible, some way to do this better or what I may be missing?
i am v new to awk, well unix as a whole really but im enjoying it alot...
im trying to extract some data from a file, and parsing it into arrays, ive trawled for hours on the internet and cant find much when it comes to awk and arrays??
anyway, heres the file:
tableA tableB tableC
... (2 Replies)
I have a database that include 5 tables, and they are related to each other through foreign key relations. The root is called colleges. There are multiple colleges, and each college has 1+ departments, each department has 1+ IT stuff, each IT stuff owns 1+ IP addresses. I have designed the database... (0 Replies)
hi Gurus,
I'm a newbie in scripting please check my script if this is correct. I think there's something wrong with it but I;m not sure. I'm trying to create multiple lines using awk from external xml files but i want to add additonal info in the data manually
Since i don't knwo how to... (0 Replies)
Hello All,
I have code as follows :-
while true do
{opening a case1 statement}
1)
{opening another case2 statement}
{closing case 2}
2)
Showing error for "2)" as Syntax error at line 59 : `)' is not expected.
*)
{closing case 1}
... (5 Replies)
Hi experts,
I am totally stuck with this.
I run a looping "for" command for multiple directories, manually, I have done this :
vfor dir in A B; do
cp -p $dir/X.txt X-${dir}.txt
done
where A and B is directory name.
However, I need to run for many directories.
So I have tried this :... (7 Replies)
i just started learning arrays and found this example on the net:
for (( i = 0 ; i < ${#names} ; i++ ))
do
echo ${names}
done
However, even though I can echo ${#names}
I am unable to get the increment to work. I have tried eliminating spaces and changing brackets and nothing seems... (4 Replies)
Hello friends,
I want to run this code on every document in every sub-directory.
tr -d '\n' < MulitpleInput.txt | awk '{gsub(/\. /,".\n");print}' | grep “\
I tried several looping techniques but couldn't get it to run in this example. Any ideas?
Thank you (2 Replies)
Hi All
I need really really help with this :-
I have two files ( File1 , File 2) both files are output of two different scripts.
File1 usually has a list of names ( sometimes 3 names sometimes 5 sometimes more , depends about the output of the script)
File2 usually has a list of numbers... (2 Replies)
Hi,
I'm trying to get the number of files inside same kind of folders on each disks and assigning each values in to a variable named with same folder and disk name so that it'll be easy for me to identify each time.But somehow I'm not able to assign those values in that specific name variable... (1 Reply)
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
LEARN ABOUT DEBIAN
xpaset
xpaset(3) SAORD Documentation xpaset(3)NAME
XPASet - send data to one or more XPA servers
SYNOPSIS
#include <xpa.h>
int XPASet(XPA xpa,
char *template, char *paramlist, char *mode,
char *buf, int len, char **names, char **messages,
int n);
DESCRIPTION
Send data to one or more XPA servers whose class:name identifier matches the specified template.
A template of the form "class1:name1" is sent to the XPA name server, which returns a list of at most n matching XPA servers. A connection
is established with each of these servers and the paramlist string is passed to the server as the data transfer request is initiated. If an
XPA struct is passed to the call, the persistent connections are updated as described above. Otherwise, temporary connections are made to
the servers (which will be closed when the call completes).
The XPASet() routine transfers data from buf to the XPA servers. The length of buf (in bytes) should be placed in the len variable.
A string containing the class:name and ip:port of each of these server is returned in the name array. If a given server returned an error
or the server callback sends a message back to the client, then the message will be stored in the associated element of the messages array.
NB: if specified, the name and messages arrays must be of size n or greater.
The returned message string will be of the form:
XPA$ERROR [error] (class:name ip:port)
or
XPA$MESSAGE [message] (class:name ip:port)
The return value will contain the actual number of servers that were processed. This value thus will hold the number of valid entries in
the names and messages arrays, and can be used to loop through these arrays. In names and/or messages is NULL, no information is passed
back in that particular array.
The mode string is of the form: "key1=value1,key2=value2,..." The following keywords are recognized:
key value default explanation
---------------------------------
ack true/false true if false, don't wait for ack from server (after callback completes)
verify true/false false send buf from XPASet[Fd] to stdout
doxpa true/false true client processes xpa requests
The ack keyword is useful in cases where one does not want to wait for the server to complete, e.g. if a lot of processing needs to be done
by the server on the passed data or when the success of the server operation is not relevant to the client.
Normally, an XPA client will process incoming XPA server requests while awaiting the completion of the client request. Setting this vari-
able to "false" will prevent XPA server requests from being processed by the client.
Example -
#include <xpa.h>
#define NXPA 10
int i, got;
int len;
char *buf;
char *names[NXPA];
char *messages[NXPA];
...
[fill buf with data and set len to the length, in bytes, of the data]
...
/* send data to all access points */
got = XPASet(NULL, "ds9", "fits", NULL, buf, len, names, messages, NXPA);
/* error processing */
for(i=0; i<got; i++){
if( messages[i] ){
fprintf(stderr, "ERROR: %s (%s)
", messages[i], names[i]);
}
if( names[i] ) free(names[i]);
if( messages[i] ) free(messages[i]);
}
SEE ALSO
See xpa(7) for a list of XPA help pages
version 2.1.14 June 7, 2012 xpaset(3)