|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
interactive scripting
Hi
I am very new to UNIX scripting and want to do something that I hope is pretty simple ... Is there any way to allow a UNIX script to execute interactive commands inside a non-unix program? For example, I have a program called 'smart' that is called with the following instruction at the command-line ... smart inter spec which then presents a prompt to the user in the form Smart(ntq?): and the user is expected to enter the next instruction (i.e. n, t or q). I want to write a script that will execute the first 'smart inter spec' part, which I have, and works fine, and then execute a command at the Smart(ntq?): command prompt, without requiring any user interaction. I suppose in a way, this is similar to the "-f" (force) option on the "mv" command. Is this at all possible? Thanks in advance Ryen P.S. For those interested, SMART is an experimental search system used in information retrieval research |
|
#2
|
|||
|
|||
|
Unless it was intentionally blocked (eg. with ssh or password this could be the case), you can "pipe" commands to another program and it will treat it like if somebody typed it.
eg.: echo -e "t\n" | smart (the -e tells it to interpret the "\n" which resembles a RETURN)
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > interactive scripting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|