Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Can YOU do this with Cygwin??

  • 19-08-2008 7:17am
    #1
    Registered Users, Registered Users 2 Posts: 2,593 ✭✭✭


    Hello, basically I'm having a bit of trouble trying to figure out how to do something.

    I have a programme that I'm using with Cygwin. I want to run it in batch mode, but there seems to be no -b option or any alternative.

    I assumed you'd be able to run a programme from a script file, and then the lines after you called the programme would be commands that the programme would open. This is obviously not the case.

    So how do I go about writing a script that can open a programme on one line,and give commands to the programme on the following lines?


Comments

  • Registered Users, Registered Users 2 Posts: 1,065 ✭✭✭Snowbat


    If the program is interactive but the author did not allow for user input to be passed as options on the command line, you can use an Expect script to talk to it.


  • Closed Accounts Posts: 18,966 ✭✭✭✭syklops


    OP, what is the program your trying to use?

    That might help us help you a bit more.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Sounds like expect is what you're looking for alright.


  • Registered Users, Registered Users 2 Posts: 2,593 ✭✭✭Sea Sharp


    It's a programme called 'Klsyn' used to make the stephen hawkins type voice. Basically the programe generates a wavfile based on user defined commands.

    The programme manual has refers to this in the following:
    The second argument of this type is the '-c' (control file)
    option. This option allows you to run KLSYN non-interactively from
    an external file. When specified, KLSYN will look for its input
    from the file bearing the name that you give it immediatley
    following the option (no spaces should appear between the -c and
    the filename). The default extension on this file is '.ctl'. If
    no extension is given, KLSYN will look for a file with the basename
    that you specified and the '.ctl' extension. If the filename given
    already has an extension on it, KLSYN will just leave that filename
    and extension alone and look for that file. An example usage of
    this option looks like this:

    klsyn -cFilename<CR> or klsyn baa -cFilename

    In the above example, KLSYN will try to get its input from the file
    named Filename.ctl. If the specified file can not be found, an
    error message will be printed to the screen and the program will
    abort.[NOTE (JH): THIS -c OPTION DOES NOT SEEM TO WORK. I CHECKED THE
    SOURCE CODE AND THERE DOES NOT SEEM TO BE ANYTHING THERE THAT
    LOOKS FOR THIS OPTION.KLSYN CAN BE RUN IN BATCH MODE, THOUGH. SEE
    THE examples directory -- 'syndaga.bat' and 'daga01.cmd'-'daga10.cmd')

    Basically, with KLsyn there are two ways of defining parameters. You can define a parameter table in a text file, or you can manually enter values from the command line.

    The way, that reads parameters from a file, for some reason does not seem to be working correctly. i.e if i have 4 variable varying it works ok. If 20 variables are varying the programme crashes.

    However, you can also define parameters from the command line. When I define variables in this manner, it works ok. The problem is, in order to sucsessfully define all of the 40 parameters, a script file about 4 a4 pages is needed.

    I could easily generate this script file from other functions. The question is, how do I write a script that opens a programme and then enters commands within that opened programme.

    Thanks for replys lads. :o


Advertisement