Discussion:
appending a file to stdin
(too old to reply)
Angel Tsankov
2006-09-08 14:15:12 UTC
Permalink
Is there a command that appends the contents of a file to its standard input and sends this to standard output?
Steve Foley
2006-09-08 14:38:33 UTC
Permalink
How about

cat - myfile
Post by Angel Tsankov
Is there a command that appends the contents of a file to its standard
input and sends this to standard output?
Angel Tsankov
2006-09-08 15:05:07 UTC
Permalink
Post by Steve Foley
How about
cat - myfile
Great! Thanks!
Unruh
2006-09-08 14:58:15 UTC
Permalink
Post by Angel Tsankov
Is there a command that appends the contents of a file to its standard input and sends this to standard output?
No idea what you mean.
cat file1 file2 file3
will output to stdout the concatenation of file1 file2 file3 in order.
If you want that sent to program
cat file1 file2 file3|program
CBFalconer
2006-09-08 16:27:21 UTC
Permalink
Post by Angel Tsankov
Is there a command that appends the contents of a file to its
standard input and sends this to standard output?
cat - filename

note spaces.

Please limit your line lengths to something under 72. 65 is good.
--
"The smaller aperture of the lid has been designed to prevent
hedgehogs from entering the McFlurry container in the
unfortunate incidence that the lid is littered"
-- McDonalds, as quoted in Time, 2006-09-11
Robert Heller
2006-09-08 16:50:01 UTC
Permalink
Post by Angel Tsankov
Is there a command that appends the contents of a file to its standard input and sends this to standard output?
cat - somefile

Example:

ls -l | cat - ~/.login | a2ps -2

See 'man cat' for more details.
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
***@deepsoft.com -- Contract Programming: C/C++, Tcl/Tk
Continue reading on narkive:
Loading...