LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-29-2005, 05:50 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Bash: how to write a wrapper script?


I want to write a bash wrapper script, that:
1. Starts a program
2. Listens to my keystrokes
3. Sends specific commands to the standard input of the program started by the script when I strike a key

An example: when I hit letter "q", the script should catch it, and send command "quit" to the standard input of the program started by the script.

In other words (I am not very experienced in programming, but I hope I use the correct terminology):

1. I want to detach the script's child process from the terminal, so that the parent (the script) could receive terminal input; meanwhile
2. the parent should open a pipe to the standard input of the child process, so that it could send data to the child process.

Is this possible in bash?

Last edited by J_Szucs; 01-29-2005 at 08:27 PM.
 
  


Reply


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
help on shell script as a wrapper to launch default programs according to input file daveiro Programming 2 11-24-2005 04:20 PM
Write a script to send an email from bash kpelczar Linux - Software 5 02-09-2005 04:19 PM
Wrapper needed for BASH Script outspoken Programming 0 01-12-2005 09:04 AM
Anoyone willing to write a BASH script for me? pilot1 Programming 4 09-16-2003 08:56 PM
server wrapper script yapp Programming 2 08-02-2003 11:09 AM


All times are GMT -5. The time now is 12:31 AM.

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