Consolidating Pipes


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Consolidating Pipes
# 1  
Old 12-18-2006
Consolidating Pipes

This is something I've given a lot of thought to and come up with no answer.

Say you have a data stream passing from a file, through process A, into process B. Process A only modifies a few bytes of the stream, then prints the rest of the stream unmodified. Is there any way to stream the file into process B directly instead of doing redundant reads and writes?
# 2  
Old 12-21-2006
Not sure what you want to do

Do you have a better example.....

May depend on what you what to do?
# 3  
Old 12-21-2006
Do you know the position of the changes in advance?
# 4  
Old 12-21-2006
Position? It's a pipe.

I've thought of lots of applications for this idea, but the original one was a sort of temporary automatic buffer. One process produces data and writes it to the next, the next buffers it, the third reads from the buffer. When the buffer bottoms out, the process joins the input and output pipes together then quits.
# 5  
Old 12-21-2006
Quote:
Originally Posted by Corona688
Position? It's a pipe.
It was a stream in your original post.

The reason I asked this, was without being able to correlate changes and raw data, I don't see how you could avoid the duplicated read, ie you need to know in the final stream reader what bytes to read from the source and which to read from the pipe.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Consolidating multiple outputs in one file

Dears, i am stuck here i have 3 scripts running at one time and all the three scripts finish at different time and each script generate 1 file with different name. so i will have three files. i dnt know which script finish first i want to have a script which check if all the there files are... (6 Replies)
Discussion started by: mirwasim
6 Replies

2. Shell Programming and Scripting

Format data by consolidating replicated obs

Please assist with the following. I have readings R1, R2,..Rn from plants from different fields , sometimes replicated. I need to first consolidate the replicates by their mean value per plant per field. Then I need to reformat the data by partially transposing it. The missing values... (3 Replies)
Discussion started by: jianp83
3 Replies

3. Shell Programming and Scripting

Help with consolidating mails sent by executing script

I have a script which checks for swap usage of the unix server. A cron job has been created to execute this script every hour and send the output via mail. This output is only required for a particular duration and it can range anywhere from 6 hours to 10 hours. So we are commenting out the... (1 Reply)
Discussion started by: kiran1112
1 Replies

4. Windows & DOS: Issues & Discussions

Consolidating Freespace to allow shrinking partition?

i have an "old" laptop with 84gb used space, 203gb free, running 32bit Windows Vista. i've tried all defragmenting programs i could find and though some offer Free Space Defrag, they don't seem to take into account where on the disk to consolidates the space to. what i am trying to achieve is... (4 Replies)
Discussion started by: Sterist
4 Replies

5. Programming

Pipes in C

Hello all, I am trying to learn more about programming Unix pipes in C. I have created a pipe that does od -bc < myfile | head Now, I am trying to create od -bc < myfile | head | wc Here is my code, and I know I might be off, thats why I am here so I can get some clarification. #include... (1 Reply)
Discussion started by: petrca
1 Replies

6. UNIX for Dummies Questions & Answers

pipes and shells

Hi How do I direct the output from ls to for example grep a in C. I am not asking for the whole shell implementation. If I write ls|grep myfile in the shell. How is the output sent from ls to the input grep. whit int pipe(pipe); We create the pipe. I and I guess we use dup2(old... (4 Replies)
Discussion started by: isato
4 Replies

7. Shell Programming and Scripting

Adding values then consolidating lines

I'm a begginer with scripting... Have a script that pulls check information data. There are multiple lines for each check. ALL the info is the same on the line EXCEPT the charges. ie: same check number, same payee, same patient, same check date, DIFFERENT CHARGE. I need to total the charges... (0 Replies)
Discussion started by: tdavenpo
0 Replies

8. Shell Programming and Scripting

cd using pipes

Hi, Can the cd command be invoked using pipes??? My actual question is slightly different. I am trying to run an executable from different folders and the path of these folders are obtained dynamically from the front end. Is there a way in which i can actually run the executable... (2 Replies)
Discussion started by: Sinbad
2 Replies

9. Filesystems, Disks and Memory

PIPEs and Named PIPEs (FIFO) Buffer size

Hello! How I can increase or decrease predefined pipe buffer size? System FreeBSD 4.9 and RedHat Linux 9.0 Thanks! (1 Reply)
Discussion started by: Jus
1 Replies
Login or Register to Ask a Question