1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Rep Power

    interactive scripting


    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


    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


    P.S. For those interested, SMART is an experimental search system used in information retrieval research
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Back in the real world.
    Rep Power
    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.

    echo -e "t\n" | smart

    (the -e tells it to interpret the "\n" which resembles a RETURN)

IMN logo majestic logo threadwatch logo seochat tools logo