[comp.unix.questions] redirecting the output of pg to another tty

mdv@comtst.domain.com (Mike Verstegen) (09/28/90)

We have an application where we have one regular dumb terminal and an
"auxillary" terminal that is display only (no keyboard). We want to
page through a file and display it on the aux terminal. I have tried
things like
	pg FILE > /dev/ttyxx		# no good -- input attached to ttyxx
	pg FILE | cat > /dev/ttyxx	# scrolls through without stopping
and another approach using mknod and trying to put a pipe betwen them to 
no avail. This appears to be because pg wants to re-open stdout or /dev/tty
to get the controlling input from the user for when it's used at the end
of the pipe.

Before I go out and dig through the archives and pick up 'less' or something
similar, does anybody see an easier way to do this? (If Larry Wall can do it
in perl, I'll finally have an excuse to get it!)

Thanks for your assistance,

Mike
--
Mike Verstegen          Domain Systems, Inc           Voice +1 407 686-7911
..!uunet!comtst!mdv     5840 Corporate Way #100       Fax   +1 407 478-2542
mdv@domain.com          West Palm Beach, FL 33407

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (09/28/90)

In article <305@comtst.UUCP> mdv@comtst.domain.com (Mike Verstegen) writes:
> We have an application where we have one regular dumb terminal and an
> "auxillary" terminal that is display only (no keyboard). We want to
> page through a file and display it on the aux terminal.

La dee da dee da... If only you were using BSD:

  % pty pg FILE > /dev/ttyxx

Or maybe | tee /dev/ttyxx, so you can see what's going on where you're
typing.

---Dan

guy@auspex.auspex.com (Guy Harris) (09/30/90)

>La dee da dee da... If only you were using BSD:
>
>  % pty pg FILE > /dev/ttyxx

If he were using BSD, he might not have "pg".

Is "pty" completely incapable of running under any system not BSD? (Just
because something isn't BSD doesn't mean it doesn't have pseudo-ttys;
even if they're different in some ways from BSD ptys, e.g.  the S5R4
ptys, it may be possible to port "pty" to that system.)

gt0178a@prism.gatech.EDU (JIM BURNS) (09/30/90)

in article <4113@auspex.auspex.com>, guy@auspex.auspex.com (Guy Harris) says:

> Is "pty" completely incapable of running under any system not BSD? (Just
> because something isn't BSD doesn't mean it doesn't have pseudo-ttys;
> even if they're different in some ways from BSD ptys, e.g.  the S5R4
> ptys, it may be possible to port "pty" to that system.)

In fact, if the SysV system is running shl(1), it seems it would *have* to
support pty's.

-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

gwyn@smoke.BRL.MIL (Doug Gwyn) (09/30/90)

In article <4113@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>  % pty pg FILE > /dev/ttyxx
>If he were using BSD, he might not have "pg".

Yeah, but he COULD, simply by acquiring SVR2 licensing and getting hold of
my SVR2 emulation for 4.nBSD...

kimcm@diku.dk (Kim Christian Madsen) (10/01/90)

gt0178a@prism.gatech.EDU (JIM BURNS) writes:

>in article <4113@auspex.auspex.com>, guy@auspex.auspex.com (Guy Harris) says:

>> Is "pty" completely incapable of running under any system not BSD? (Just
>> because something isn't BSD doesn't mean it doesn't have pseudo-ttys;
>> even if they're different in some ways from BSD ptys, e.g.  the S5R4
>> ptys, it may be possible to port "pty" to that system.)

>In fact, if the SysV system is running shl(1), it seems it would *have* to
>support pty's.

Not all SysV systems support shl(1)....

The sysV systems that support shl(1) usually does this by the use of
sxt which is another form of pseudo-tty's that uses another command-set
to use, hence the pty-using programs must be re-written to take advantage
of the sxt devices.....

Even others systems support pty's but only on the console port!?!....(No
names mentioned )-:).

					Kim Chr. Madsen