LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-24-2007, 08:36 AM   #1
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Rep: Reputation: 15
problem using tee | adventure


Usually, adventure accepts input from the terminal, and all works fine.

When I use
Code:
tee file | adventure
to write the input to a file, I can't see the last line of output from adventure until I press enter.
This is a problem, because I don't want to send \n to adventure.

This problem also happens with cat | adventure
 
Old 05-24-2007, 03:50 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Does adventure use ncurses or some sort of unbuffered terminal access? If so, you might put your terminal in raw mode (man 1 stty).
 
Old 05-25-2007, 03:26 AM   #3
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Original Poster
Rep: Reputation: 15
The program just reads from standard input using getchar.
I'm puzzled as to why connecting the input differently would affect the output buffering.
(the problem is not specific to 'adventure')
 
Old 05-25-2007, 03:22 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
I think I misunderstand your problem. Wouldn’t you still send a linefeed to adventure when you read from stdout (without any pipes)? In any case, instead of pressing “enter”, try pressing “Ctrl-D” (depending on how adventure is implemented and what shell you use, you may need to do this twice).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tee vs > or >> DotHQ Linux - General 3 08-23-2006 01:31 PM
Clonning data, fifo/pipe/tee problem : Resource temporarily unavailable rmarco Linux - General 2 05-05-2005 11:15 AM
Text adventure command problem MylesCLin Programming 6 02-11-2005 04:22 AM
Looking for a new adventure corbintechboy *BSD 12 10-24-2004 05:19 AM
want to experience the adventure.Help me cybercop12us Linux - Networking 1 10-23-2001 09:04 AM


All times are GMT -5. The time now is 11:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration