[Gllug] share keyboard input between two applications

Nix nix at esperi.org.uk
Fri Oct 9 21:14:39 UTC 2009


On 9 Oct 2009, Victor Churchill spake thusly:
> I wondered about tee too, but couldn't see quite how it would do it.
> (Does not help that 'man tee' just gives a brief useage then refers
> you to an info page...)
> mkfifo PIPE1
> mkfifo PIPE2
> # read a keybrd line, echo it onto both pipes
> while true ; do read xx; echo $xx > PIPE1; echo $xx > PIPE2; echo next:; done &
>
> elsewhere
> tail -f PIPE1

Nah, just

cat PIPE1

as cat blocks when it has no input waiting (on non-regular-files). (tail
-f in all but the very most recent GNU coreutils is much less
efficient.)
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list