>> I have since tried this on a work Ubuntu machine, and it "works".
>> That is, "cat | script -c sh | cat" (-u not necessary, turns out)
>> gives an interactive shell that accepts commands and returns results
>> like any other shell.
> That's not really works, in that the shell run by script has
> magically found the tty instead of script(1)'s stdin.

Not according to tty(1).  Mouchine is the work Linux machine:

[Mouchine] 18> tty
/dev/pts/6
[Mouchine] 19> cat | script -c sh | cat
Script started, output log file is 'typescript'.
$ tty
tty
/dev/pts/11
$ exit
exit
Script done.
[Mouchine] 20> 

I typed the tty and exit commands.  I had to type something after the
exit to get my prompt back; in the above case I typed my eofc.  I
suspect return would have worked too.  Also notable - I missed this the
first time around - is the double echo of commands, presumably one echo
from the main tty and one from the pty allocated by script.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                [email protected]
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Reply via email to