Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'another cool solution' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
another cool solution
Authored by: SOX on Jul 25, '02 03:02:46PM

here is a solution that allows you to direct the output to another terminal window or wherever.

open a terminal window and type:
mkfifo /tmp/junk ; perl -we 'while (1) { die unless open FILE ,"/tmp/junk"; \
print $x while ( $x=<FILE>); warn "---end of file--\n" }'

you only need to do that part one time.
then from any other terminal just redirect the output to /tmp/junk

for example:
ls -l >/tmp/junk

will send the output to the other terminal window.
for a cool example try
cat >/tmp/junk

and as you type lines they appear in the other window.

you can of course do whatever you want with the text in the other window. send it to a file or parse it or whatever by adding the approriate redirects in the original command.



[ Reply to This | # ]