Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: vvaidyan
Forum: Programming 05-15-2008
29,968
Posted By vvaidyan
problem solved
There is high potential for me to get beaten up in this forum for what silly mistake i did, which was causing all the problem. But I know several people have looked in through this thread spending...
Forum: Programming 05-15-2008
4,590
Posted By vvaidyan
# define MAXLINE 1024 char...
# define MAXLINE 1024

char line[MAXLINE];

while( (rv = read(fd2[0], line, MAXLINE)) != 0)
{
// do whatever
}
Forum: Programming 05-15-2008
4,590
Posted By vvaidyan
you are right!
Thanks for the help gautham... yes, if I execute the read statement one more time with the same pipe and another char array, I am able to read the next set of buffered output in the pipe. Which means...
Forum: Programming 05-14-2008
29,968
Posted By vvaidyan
Shamrock, sorry about not providing proper...
Shamrock, sorry about not providing proper details previously.

Program A does have main() fn separately. Program A and B are completely two different programs, just that Program B is called...
Forum: Programming 05-14-2008
29,968
Posted By vvaidyan
can you please tell me the syntax? According...
can you please tell me the syntax?

According to the code above, am already reading from the pipe after exec'ing program B. Can you please point in code if I had done anything wrong?

Thanks,...
Forum: Programming 05-14-2008
29,968
Posted By vvaidyan
Thanks for the reply shamrock, but it is not...
Thanks for the reply shamrock, but it is not solving the problem.

I am able to read the output of PROGRAM B inside PROGRAM A through char line[]. I am receiving output. But the problem is, the...
Forum: Programming 05-14-2008
29,968
Posted By vvaidyan
How to clear the content of a pipe (STDIN) after it is written to another program?
PROGRAM A <-> PROGRAM B
PROGRAM A sends data as STDIN ro PROGRAM B and when PROGRAM B is executed from PROGRAM A, it sends output back to PROGRAM A. This is implemented using 2 pipes (fd1 & fd2).
...
Forum: Programming 05-14-2008
113,352
Posted By vvaidyan
Found the solution. Between two binaries,...
Found the solution.

Between two binaries, one pipe can serve only one way communication. YOU need two pipes for to and fro communication. You need one pipe to write data to STDIN of another...
Forum: Programming 04-30-2008
7,286
Posted By vvaidyan
How to write to stdin of another program (program A -> [stdin]program B)
Hi,
Program A: uses pipe()

I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:

* child
-> dup2(fd[1], STDOUT_FILENO);
-> execl("/path/PROGRAM...
28,337
Posted By vvaidyan
How to write to stdin of another program (program A -> [stdin]program B)
Hi,
Program A: uses pipe()

I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:

* child
-> dup2(fd[1], STDOUT_FILENO);
-> execl("/path/PROGRAM...
Forum: Programming 04-17-2008
4,590
Posted By vvaidyan
parent not waiting until child complete executing another program through execl()
Hi,
I am calling a program that greps and returns 72536 bytes of data on STDOUT, say about 7000 lines of data on STDOUT.

I use pipe from the program am calling the above program. Naturally,...
Forum: Programming 03-24-2008
113,352
Posted By vvaidyan
C++ How to use pipe() & fork() with stdin and stdout to another program
Hi,
Program A: uses pipe()

I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:

* child
-> dup2(fd[1], STDOUT_FILENO);
->...
21,358
Posted By vvaidyan
Got it... accessed through $0 / $1 / $2,...
Got it...

accessed through $0 / $1 / $2, depending upon the position of the argument.

Thanks,
vvaidyan
21,358
Posted By vvaidyan
Thanks Keelba, from your program, I got it into...
Thanks Keelba, from your program, I got it into one liner:

(echo "1.txt";echo "2.txt") | xargs zgrep -n STRING | awk -F: '{printf "%s %s", $1" -", $2 "\n"}'

Later:

xargs zgrep -n STRING |...
21,358
Posted By vvaidyan
How to grep / zgrep to output ONLY the matching filename and line number?
Hi all,
I am trying to zgrep / grep list of files so that it displays only the matching filename:line number and does not display the whole line, like:

(echo "1.txt";echo "2.txt") | xargs...
Showing results 1 to 15 of 15

 

Featured Tech Videos

All times are GMT -4. The time now is 12:26 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy