[comp.unix.shell] Concatenation of stdin and a file??

neulynne@uts.uni-c.dk (Mogens Lynnerup) (05/06/91)

I wonder if anyone can help one of my colleges with a problem that has been 
teasing us a bit.

What he would like to do is to concatenate stdin and some file so he can do
something like:
			telnet <some-node> < <some-file>

and when the file is exhausted telnet should continue accepting input from the
keyboard and NOT exit due to an EOF-condition from the file.

-Mogens
-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+      Mogens Lynnerup                                                        +
+      UNI-C Aarhus, Danish Computing Centre for Research and Education.      +
+      Olof Palmes Alle 38, DK 8200 Aarhus C.                                 +
+      Phone: +45-86-784444                                                   +
+                                                                             +
+      E-Mail: neulynne@uts.uni-c.dk or neulynne@vm.uni-c.dk                  +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

weimer@goose.ssd.kodak.com (Gary Weimer (253-7796)) (05/07/91)

In article <1991May6.160308.19911@uts.uni-c.dk>, neulynne@uts.uni-c.dk
(Mogens Lynnerup) writes:
|> I wonder if anyone can help one of my colleges with a problem that has been 
|> teasing us a bit.
|> 
|> What he would like to do is to concatenate stdin and some file so he can do
|> something like:
|> 			telnet <some-node> < <some-file>
|> 
|> and when the file is exhausted telnet should continue accepting input
from the
|> keyboard and NOT exit due to an EOF-condition from the file.

how about 'cat <some-file> - | telnet <some-node>'?

weimer@ssd.kodak.com ( Gary Weimer )

jetfuel@babbage.csus.edu (Dave Jenks) (05/07/91)

In article <1991May6.160308.19911@uts.uni-c.dk> neulynne@uts.uni-c.dk (Mogens Lynnerup) writes:
>What he would like to do is to concatenate stdin and some file so he can do
>something like:
>			telnet <some-node> < <some-file>
>
>and when the file is exhausted telnet should continue accepting input from the
>keyboard and NOT exit due to an EOF-condition from the file.

How about:

    cat some-file /dev/tty | telnet

I did something like this, only /dev/tty was first, because I needed
to manually prime a complex piece of software.  "It worked for me."

--Dave
--
=======================================================================
	    "Pro is to con, as progress is to Congress..."
>>-@@-> Dave Jenks              {uunet | ucbvax!ucdavis}!csusac!jetfuel
=======================================================================

jimr@hplsdv7.COS.HP.COM (Jim Rogers) (05/07/91)

Try using a command in the following form;

cat <some-file> - | telnet <some-node>


Refer to the following excerpt of the cat man page for confirmation of
how this works:




               cat file1 file2 >file3

          concatenates the first two files and places the result on
          the third.

          If no input file is given, or if the argument - is
          encountered, cat reads from the standard input file,
          enabling you to combine standard input with other files.


Jim Rogers
Hewlett-Packard Company
Colorado Springs, Colorado
United States of America