| Pascal Bourguignon 2005-04-11, 5:59 pm |
| "Norm Dresner" <ndrez@att.net> writes:
> Any number of times I've found myself yearning for the old MS-DOS PC's
> multiple video pages using EGA/VGA output cards. I have written, for
> example, a whole series of very useful and complex real-time control
> programs that use up to 8 simultaneous video pages for which the program has
> to do nothing more to put something on a secondary page than to copy the
> text & attributes to a different area of video memory than is used for the
> primary page and the video memory for all pages exists simultaneously and
> the program need do nothing to create them.
>
> In *NIX systems I know how to write separate programs which receive input
> either via a pipe or IPC messaging (or I guess shared memory too) but I was
> wondering if there's something I've overlooked in getting a text-based
> program in an xterm shell window to open a second window for (at least)
> output?
xterm !
For example:
% cat ex-xterm
#!/bin/bash
pipe="/tmp/$$.pipe"
trap "rm $pipe" 0
mknod "$pipe" p
xterm -sb -sl 10000 -e "tty>>$pipe;cat>$pipe" &
read terminal < "$pipe"
echo $pipe $terminal
while read line ; do
case "$line" in
*[aeiou]*) echo "$line" > "$terminal" ;;
*) echo "$line" ;;
esac
done
% ( echo "Hello" ; echo "Zzzz" ) | ./ex-xterm
will display Hello in a new xterm, and Zzzz in the current shell.
--
__Pascal Bourguignon__ http://www.informatimago.com/
Nobody can fix the economy. Nobody can be trusted with their finger
on the button. Nobody's perfect. VOTE FOR NOBODY.
|