PIpe Spy


 
Thread Tools Search this Thread
Top Forums Programming PIpe Spy
# 8  
Old 02-17-2004
no no no no no, those have to be EXECUTABLES. you can not *execute* a text file. a text file simply contains DATA. obviously you will get a "command not found" error, because prog1.txt and prog2.txt are not commands. understand?



program1 is executed, the output is then piped ( | ) to tee, tee takes a filename as an argument, and dumps the output from program1 to the given filename, at the same time, tee also outputs (dumps to the screen) the output from program1, which you then pipe to program2.
# 9  
Old 02-17-2004
Quote:
Originally posted by S.P.Prasad
Perhaps it could work out this way:

prog 1 | ./pipespy myfile.dat | prog2

The executable 'pipespy' should read the standard input and before writing the data to standard output store it within a file named 'myfile.dat'
S.P., what kind of a solution is that? You've restated the problem... Smilie

I'm wondering, jodders - are prog1.txt and prog2.txt actually scripts? Or do they just contain some data? Like norsk said, simple text files can't be executed. If these are scripts, then read up on the "chmod" command.
# 10  
Old 02-17-2004
ok cheers guys.i guess i have to make it an executable C++ file.What data can i put? i could have like a print out "hello world" thing couldn't i ?LIke a very simple command.What do i put in prog2? If its going to pipe to prog2,do i create an empty executable?
# 11  
Old 02-17-2004
Re: PIpe Spy

Quote:
Originally posted by jodders
i guess i have to make it an executable C++ file.What data can i put? i could have like a print out "hello world" thing couldn't i ?LIke a very simple command.What do i put in prog2? If its going to pipe to prog2,do i create an empty executable?
Wow, looking at this thread, it's resembling homework more and more... can you tell us what exactly you're trying to do jodders? Like what you're actually trying to accomplish, since no one decides to just create some programs to pipe into each other...
# 12  
Old 02-18-2004
Originally posted by oombera
S.P., what kind of a solution is that? You've restated the problem...


The problem was:
prog 1 | ./pipespy myfile.dat | prog2

the standard output of prog1 is supplied as the input to prog2 and copied into file myfile.dat.

And if you create an executable(pipespy) which reads standard input stream and stores data read into a file before it writes back to the standard output will achieve the objective.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

2. Shell Programming and Scripting

Replace pipe with Broken Pipe

Hi All , Is there any way to replace the pipe ( | ) with the broken pipe (0xA6) in unix (1 Reply)
Discussion started by: saj
1 Replies

3. Solaris

Can we spy a tty session?

First of all, in no way I want to use this to hack / cheat / steal etc ... I am an admin of a couple of hundred users which are 99,8% > 500miles away from me and to facilitate some administration part I would like to be able to "spy" what they are doing in there sessions, live. ex: ... (7 Replies)
Discussion started by: plmachiavel
7 Replies

4. UNIX for Dummies Questions & Answers

i-spy for UNIX - What is it??

I'm just after finding a file resding in my temporary directory(/tmp) on my machine called 'i-spy' This file is owned by root and ordinary muppets like me cant delete it, open or even do a more or cat on it. I'm running Solaris 2.6 on a Sun Ultra 5. Can anyone out there give me a good... (1 Reply)
Discussion started by: Kanu77
1 Replies

5. Shell Programming and Scripting

Game spy arcade for halo and macintosh?

I need help i heard you can play halo over online and you have a macintosh version where can I get it please respond (1 Reply)
Discussion started by: memattmyself
1 Replies

6. Shell Programming and Scripting

"SPY" script - please help

hello guys, I'm in need of some help with a certain script. The link to my assignment is below...any and all advice/pointers/suggestions will be greatly appreciated. thanx, Jake Axon http://www.cs.uic.edu/~i101/mp6.html (2 Replies)
Discussion started by: Axon
2 Replies
Login or Register to Ask a Question