View Single Post
Old 31st August 2014
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by spermwhale_warrior View Post
THAT is what I want. It is surprising that we found an impredictable behavior.
It should work, or at least we should know that it can't.
I feel sure the problem is with the predictors (that is, us ). It probably works correctly, but we don't understand all the "inner workings" of how it may be affected by terminal configuration (e.g., input buffering) and how/when it takes over input from the program (a shell) already running in the second terminal.

Granted, there is a theoretical question here of how it works, that could be studied for a long time. But I'm not really sure why you would want to do this. Maybe I haven't read the other posts carefully enough and it is explained there.

Quote:
(cat < /dev/ttyE2) | tee myfile do not echo anything in myfile, and on ttyE2 was a ongoing string of yes.
insteat, it occupy the current tty, like it was waiting data. But nothing got on the file.
I thought I understood the logic of echo, cat, tee and the redirections, but it seems there are some mysteries yet.
Did you try my second example? Once the text stopped echoing in the second terminal (where it was being typed) --- I called this "getting stuck" above --- then that stuff went into the file. I'm not sure why your example behaved differently, and I'm in X now so ... must try later.
Reply With Quote