It is currently Tue, 30 Nov 2021 17:27:53 GMT



 
Author Message
 standard input instead of input file
Hi,

Consider the paste command.

paste requires input_file_name.

Using the command line
        paste `tty`
we can enter data from standard input.

Is there any other way to do it? (I would like to use pipe with paste).

        Thanks in advance,
        Alex

Sent via Deja.com http://www.**-**.com/
Share what you know. Learn what you don't.



 Sun, 06 Jan 2002 03:00:00 GMT   
 standard input instead of input file
In article <7n4b3r$ph...@nnrp1.deja.com>,
  Alex Vinokur <alexander.vino...@telrad.co.il> wrote:

I don't follow.
Are you asking whether there's another way to read standard input from
the shell? (and maybe stick in a variable or pipe it to another tool?)
Can you use 'read' (man (0)sh) for that?

This seems too simple...I must not be following your question.

Cheers,
Dave

--
+---------------------+---------------+
|nojunkm...@nospam.com| mindspring.com|
|nos...@nojunkmail.com| davegrantier@ |
+---------------------+---------------+

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



 Sun, 06 Jan 2002 03:00:00 GMT   
 standard input instead of input file
Alex Vinokur <alexander.vino...@telrad.co.il> wrote in comp.unix.admin,comp.unix.questions,comp.unix.shell,alt.unix.wizards:
|Using the command line
|       paste `tty`
|we can enter data from standard input.
|
|Is there any other way to do it? (I would like to use pipe with paste).

foo | paste -

It's in the man page (assuming GNU paste, since you don't say which
version),

                        Pete
--
J.J. Thomson Physical Laboratory   | Email: p.h.r.hous...@reading.ac.uk    
PO Box 220, Whiteknights, Reading, | Phone: +44-118-9875123 ext 7594
Berkshire, RG6 6AF, United Kingdom | Fax:   +44-118-9750203                
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WWW: http://www.rdg.ac.uk/~spr96phh/pete.html Use lynx - you know you want to!



 Sun, 06 Jan 2002 03:00:00 GMT   
 standard input instead of input file
1.      The way you have it written, you won't get standard input.
        You will get one line which is the device name for your
        terminal. You really ought to try your examples before writing
        them.

2.      The man page for paste quite clearly tells you how to get
        standard input. I leave it as an exercise for you to read
        same.

3.      It occurs to me that this might be a homework question, in
        which case [2] is even more relevant.

4.      Always read the man page first. The man pages are your friend.



 Sun, 06 Jan 2002 03:00:00 GMT   
 standard input instead of input file
Kurt J. Lanza <k...@inforonics.com> wrote:

I see no reason why
should not work, in fact I just tried it successfully.
Could you explain?

tobias

Always RTFM.



 Sun, 06 Jan 2002 03:00:00 GMT   
 standard input instead of input file
In article <slrn7pbk1c.4ul.trich...@kiwi.ipk.fhg.de>,
  trich...@ipk.fhg.de (Tobias Richter) wrote:

  The example was tested before posting the message.

 Also I have got the same reults. I does work.

  Also I would like to get any explanation:
  1. Why must not it work?
  2. Why does it work?

        Thanks in advance,
        Alex

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



 Mon, 07 Jan 2002 03:00:00 GMT   
 standard input instead of input file

After re-thinking it came clear to me that in fact
        paste `tty`
will not read from standard input, but from your
terminal. So e.g.
        paste `tty` < file
will fail.

The way it works is:
'tty' give you the filename of your terminal.
the backticks (`) are a shell special for "replace
with output of enclosed command". So
        paste `tty`
invokes 'paste' with your tty name as single argument.

Bye,
tobias



 Tue, 08 Jan 2002 03:00:00 GMT   
 standard input instead of input file
On 22 Jul 1999 23:01:32 -0500, bmar...@iglou.com <bmar...@iglou.com> wrote:

The `tty` command gets evaluated before the redirections occur.

                --Ken Pizzini



 Fri, 11 Jan 2002 03:00:00 GMT   
 
   [ 8 post ] 

Similar Threads

1. Trouble using rlogin with a file redirected to standard input

2. X Window not accepting input or input focus


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software