ccemdd@rivm.UUCP (Marco Dedecker) (05/25/89)
I wish to make a program that will ask the user to select a utility program he wishes to execute. After the user has entered his/her choice, the program will execute the chosen utility. I know this can be done from CLI using setkey and setmap, but I want a program instead of it. The execution can be done by using the command : execute(command, stdin, stdout) But this is not what I want. I want the execution to wait until my program has finished. Can this be done ? - Will redirecting STDOUT to STDIN cause this and if so how is this done ? - Is it possible to add commands to the keyboard queue ? - Is there an other solution ? I would welcome any help. Marco Dedecker
andy@cbmvax.UUCP (Andy Finkel) (05/26/89)
In article <1345@rivm05.UUCP> ccemdd@rivm.UUCP (Marco Dedecker) writes: > execute(command, stdin, stdout) > >But this is not what I want. I want the execution to wait until my >program has finished. Can this be done ? Yes. The NEWLINE character can be used as a delimiter to separate multiple commands. For example, in the CLI/Shell you can type dir df0: [NEWLINE] dir df1: [NEWLINE] info [RETURN] once you type the RETURN each of your commands is executed in turn. (NEWLINE is control J on the keyboard) This same method works in the Execute() call, for example Execute("Wait 1 min\nmyprogram\n",stdin, stdout); works fairly well. andy -- andy finkel {uunet|rutgers|amiga}!cbmvax!andy Commodore-Amiga, Inc. "Trouble can be purchased cheaply, though the refund may be more than you can afford." Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors.