Results 1 to 5 of 5
Script interfacing application
I created a bash script to interface an application I wrote.
The intention is this. The application does not have command line arguments per say but prompts ...
- 06-26-2011 #1Just Joined!
- Join Date
- Jun 2011
- Posts
- 2
Scripting/Application Interface
Script interfacing application
I created a bash script to interface an application I wrote.
The intention is this. The application does not have command line arguments per say but prompts the user for information manually in the terminal. I want to write a script (for testing purposes) that has all the input for the program. Is there a way for the program to read in directly from the script that I created, the same script which calls/starts the application? In other words, the script starts the application but does not read in the rest of the "arguments", that are written into the script. Is there a way to automatically feed an application input from the terminal without doing so manually?
Please let me know if I need to clarify myself, thanks!
- 06-26-2011 #2
Yes, it's called a "here document".
The lines between "<<" and your designated end-of-file marker will be read as input.Code:<< EOF input more input more input EOF rest of script
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 06-27-2011 #3Just Joined!
- Join Date
- Jun 2011
- Posts
- 2
Thanks for the help. Do you know the details of what happens after the second (closing) marker? I am just curious.
- 06-28-2011 #4
Everything after the marker is treated as normal commands. But since the script hibernates once the program it launched is running (unless you launched it into the background using "&" ), those commands won't be executed until the child program terminates.
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 07-02-2011 #5Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 262
Take a look at the command "expect".


Reply With Quote