The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to read terminal attributes using ioctl() Sreejesh.S High Level Programming 1 05-17-2008 10:56 AM
read terminal command munnu High Level Programming 6 01-11-2007 12:56 PM
How to read lock terminal values in solaris pankajarora_12 UNIX for Dummies Questions & Answers 0 07-11-2006 07:31 AM
Terminal Hungup at the time of read pkusumam Shell Programming and Scripting 1 11-30-2001 12:19 AM
connecting to unix through hyper terminal - as a dumb terminal michelle UNIX for Advanced & Expert Users 2 11-05-2001 11:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-21-2005
Registered User
 

Join Date: Dec 2004
Location: Zürich
Posts: 146
Stumble this Post!
read from terminal

If I do:

cat file | write user

I can cat a file to a users terminal. My question is, how can this user read the input and cat it into a file?

I tried the reverse:

read | file
or
read > file
etc.
But it didn't work.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-21-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,325
Stumble this Post!
Try this:
Code:
cat > file
this is a test file
this is the second line of the test file
^D ## this is ctrl-D
The ^D char at the end is the EOF character. On receiving this char, cat will stop reading the stdin of the user and close the file.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0