Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-13-2008, 02:45 AM   #1
LQ Newbie
Registered: Nov 2007
Posts: 26

Rep: Reputation: 15
piping input during run-time

I have an interactive application (shell) that takes input during runtime. Now, I need to create a channel such a way that when I write to that channel, the input goes to that application. After executing that line, it should wait for next input (through that channel).

I dont know how to do that in bash using redirections, (and how to google for that).

Basically, I want something like this

### Start the application
$ appln [operator] inputchannel > outputfile &
### Send commands to the appliation that runs in background
$ echo "command1 args" > inputchannel
$ echo "command2 args" > inputchannel

Can anyone please help me?

Old 10-13-2008, 03:46 AM   #2
LQ Newbie
Registered: Nov 2007
Posts: 26

Original Poster
Rep: Reputation: 15
I figured it out. But, dont know if its the right way

Create a script "" like

rm my_pipe
mknod my_pipe p
while [ $str <> "exit" ];
        str=`cat my_pipe`;
        echo $str;
        if [ $str == "exit" ]; then
Then, run the application (in this case bash shell) as

./ | bash

This script would exit at the command "exit".

I guess there should be some better way to do it...


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
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 09:15 PM
why input key everytime when run quake4 in linux? u2911 Linux - Games 3 11-27-2005 04:48 PM
an open source program that only gives the user a certain amount of time to input? dr_zayus69 Programming 4 05-22-2005 11:56 PM
Piping keyboard input to two processes (or threads) caffeinebot Programming 3 05-17-2005 05:51 PM
Screen goes blank after being idle 4 a long time & then all input devices freeze! hari_seldon99 Linux - Newbie 2 01-28-2004 08:45 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:08 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration