comp.unix.programmer
  Home FAQ Contact Sign in
comp.unix.programmer only
 
Advanced search
June 2008
motuwethfrsasuw
      1 22
2345678 23
9101112131415 24
16171819202122 25
23242526272829 26
30       27
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.unix.programmer Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Need Shell Script help         


Author: injam4u
Date: Jun 30, 2008 23:59

Hi,
I have the following file
swadmin@tb142:/rangedoms1/working/
CRST_OVERLAY_ENHANCE_Analysis_RNGCTRL_DEV> cat exp_aovr_send_new.dat
0001349000174P00000012D-ATPNB050062184TPNB050063880
0001349000174P60000329C-ATPNB050064199TPNB050064268

Now i need the above file in the below format i.e splitting up of
range character 23 to 25 in each record.
Resulting file
____________________
0001349000174P00000012DTPNB050062184TPNB050063880
0001349000174P00000012CTPNB050062184TPNB050063880
0001349000174P00000012BTPNB050062184TPNB050063880
0001349000174P00000012ATPNB050062184TPNB050063880
0001349000174P60000329CTPNB050064199TPNB050064268
0001349000174P60000329BTPNB050064199TPNB050064268
0001349000174P60000329ATPNB050064199TPNB050064268
3 Comments
  How do you update a Makefile?         


Author: chutsu
Date: Jun 30, 2008 05:38

I'm basically a summer student working on a program called Rivet.
(http://projects.hepforge.org/rivet/)..its a program that generates
histograms...(not important in what I'm tring to ask). And I'm trying
to port it to BOINC, it allows a large number of computers to be
connected together and compute large calculations, (think server farms
- For more info on BOINC google it). BOINC has some API available to
allow me to port my application RIVET to be able to use BOINC.

Now the Question! Me being an absolute beginner at programming, I
don't know how to update the Makefile in Rivet to make the main()
recognise the BOINC API and Libraries installed on my computer! I
tried editing the Makefile.am, the part where CPPFLAGS are declared to
include the BOINC APIs and Libraries, but what do I do then?

Any help would be much appreciated!
Thanks
Chris
1 Comment
  sending echo to all clients         


Author: arnuld
Date: Jun 30, 2008 03:21

I have this program, which uses poll() to handle multiple clients. It is
from UNP section 6.11 with my modifications

WANTED: If a client sends something then server should echo back that
data to *all* the connected clients.

PROBLEM: It echoes it back to only one client, the client which sent the
data.

The only major modification I made to the original program, is
introducing a for loop just after recv()ing the data:

--------------------- echo-server -----------------------------------
/* A server handeling multiple clients using poll() */
Show full article (7.18Kb)
20 Comments
  OFF TOPIC: u8m854p98su072q3l8chiss3t0lcr05fo0@4ax.com Censored By Google Groups. Gordon Sauck Is A Police Agent         


Author: Greg Carr
Date: Jun 30, 2008 02:32

It has come to my attention that my original post Mr Gordon Sauck
Replies To Me By Email And Admits To Being A Police Agent has
disappeared from Google Groups.

But is archived here and other places on the web
http://www.slashlegal.com/showthread.php?t=152681

It was sent Date: Sat, 14 Jun 2008 22:17:52 -0700 Message-ID:
4ax.com>

Regular readers of my posts know that HAMC can censor Google Groups
from time to time and since they can intimidate the courts, cops and
judiciary from time to time as well as the media and/or bribe them
and/or confuse them a major corporation isn't much of a stretch. Heck
the Mafia once extorted money from a NYSE listed company in fact two
of them from the top 500. I will try to get Google Groups to re-list
it. They should be ashamed of themselves.

Thanks to anyone who like in the past can get Google Groups to restore
the original post.
Show full article (27.93Kb)
no comments
  Using getnameinfo()         


Author: Mariano
Date: Jun 30, 2008 01:10

I have a socket-client application, on the server side I have a file
descriptor for client connection, now I've to know what is the client
name (otherwise IP address). I have tried to write a function, but ->
operator doesn't work. Someone know the solution???

void traccia_user(int fd)
{
int tmp_len;
struct sockaddr_in tmp;
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
unsigned int addrlen=sizeof(tmp);
getpeername(fd,(struct sockaddr*)&tmp,&addrlen);
printf("Client IP: %%s\nClient port: %%d
\n",inet_ntoa(tmp.sin_addr),tmp.sin_port);
tmp_len = sizeof(tmp);
if (getnameinfo(tmp, tmp->tmp_len, hbuf, sizeof(hbuf), sbuf,
sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0)
printf("host=%%s, serv=%%s", hbuf, sbuf);
}
3 Comments
  Discount Price !! Richmond D&G Shoes, Chanel Bape Belts , Jimmy Choo Handbags, etc         


Author: cheapforwholesale666
Date: Jun 29, 2008 18:18

no comments
  book on early unix utilities -- please help identify this one         


Author: Mayer
Date: Jun 29, 2008 07:31

Hello:

I'm looking for a specific book I've seen a while ago and would like
to try and get. It covered basic unix utilities, such as sed, sh, awk,
grep, etc. It was a black-cover paperback, if my memory serves me
right, before 1990. The one outstanding thing about the book, that I
can remember, is that it has a running example of a student-
registration system implemented in sed, grep, awk and sh only.

If anyone recalls such a book, please drop me a line with the title
and/or the author(s).

Thanks,

Mayer Goldberg
gmayer@little-lisper.org
1 Comment
  Error checking with execlp()         


Author: K-mart Cashier
Date: Jun 28, 2008 14:53

This questions stems from an off topic post in comp.lang.c......

The following appears to work correctly on my system

m-net%% more yes.c
#include
#include
#include

int main(void)
{
pid_t pid;
pid=fork();
if (pid==0) {
if( (execlp("who", "who", (char *)0)) < 0 ){
perror("exec failure");
exit(EXIT_FAILURE);
}
}
return 0;

}
m-net%% gcc -Wall yes.c -o yes
m-net%% ./yes
sashas ttyp0 Jun 28 15:48 (91.76.233.62)
drugr3f ttyp3 Jun 28 08:58 (124-169-99-210.d)
raju217 ttyp5 Jun 28 14:48 (12...
Show full article (2.69Kb)
33 Comments
  Will a signal interrupt a read(2) in it's middle way?         


Author: Steven Woody
Date: Jun 27, 2008 18:41

Hi,

I am working on unix domain sockets. In the sockets, we transfer data
with a specific structure. Will a signal interrupt my read(2) when it
get part of the data which already in kernel's buffer? If a reading
can be interrupted when I got part of bytes of the whole structure,
restart is not easy.

Thanks.
9 Comments
  Placement of signal handler question         


Author: grocery_stocker
Date: Jun 27, 2008 17:39

In figure 5.12 on pages 138 - 139 in the book "Unix Network
Programming: The Socket Networking API" by Stevens, Fenner, and
Rudoff, they have the following

1 #include "unp.h"
2 int
3 main(int argc, char **argv)
4 {
5 int listenfd, connfd;
6 pid_t childpid;
7 socklen_t clilen;
8 struct sockaddr_in cliaddr, servaddr;
9 void sig_chld(int);

10 listenfd = Socket (AF_INET, SOCK_STREAM, 0);

11 bzero (&servaddr, sizeof(servaddr));
12 servaddr.sin_family = AF_INET;
13 servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
14 servaddr.sin_port = htons(SERV_PORT);

15 Bind(listenfd, (SA *) &servaddr, sizeof(servaddr));

16 Listen(listenfd, LISTENQ);
Show full article (1.67Kb)
4 Comments
1 2 3 4 5 6 7 8 9