Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-14-2005, 09:26 PM   #1
Registered: Feb 2004
Location: Lexington, MA
Distribution: Gen2
Posts: 39

Rep: Reputation: 15
Piping keyboard input to two processes (or threads)

Hi there, I am trying to develope a sandbox (or testcase) scenario where I'd like user input by keyboard to be sent to two different programs (run on the same machine, but different ptys). However I am stuck on tring to figure out where to begin, and I was hoping some one here would be able to direct me.
The sandbox is basically aimed at running to instances of nano, and then opening up a third pty, running the program and be able to pipe the text into both instances of nano. Possible?
Any ideas on wether to look at threads or processes, and any specifics would be greatly apreaciated!
Old 05-15-2005, 07:49 AM   #2
Registered: Aug 2003
Location: Belguim, Ostend and Ghent
Distribution: Ubuntu
Posts: 600

Rep: Reputation: 30
you could always put your userinput into a variable first, and then pipe it once in each process instead of piping it directly.

hope this helps
Old 05-16-2005, 12:42 PM   #3
Kdr Kane
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Rep: Reputation: 30
Just a suggestion, you might be able to use the "tee" command.
Old 05-17-2005, 05:51 PM   #4
Registered: Feb 2004
Location: Lexington, MA
Distribution: Gen2
Posts: 39

Original Poster
Rep: Reputation: 15
within in the program or in bash scripted sort of way?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
A problem with threads creates 300+ zombie processes zahadumy Programming 1 11-27-2005 08:15 PM
Show processes, not threads Martin Strand Linux - Newbie 1 06-14-2005 09:46 AM
my mouse input is takes as keyboard input in BASH e1000 Slackware 5 12-08-2003 04:00 PM
Threads showing up as processes on ps command eDubster Linux - General 1 04-28-2003 05:51 PM
Piping Processes (a little different) mackie_lin Programming 4 12-27-2002 09:17 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration