Thanks for your help guys but I managed to find a solution and its quite simple. From within the script I call 'program' and it requires two arguments, name of an input file and the name of the output file it will produce, it then proceeds to its command line interface where I enter my analysis commands, cmd1, cmd2 and then exit:
Code:
program infile outfile comm="cmd1 && cmd2 && exit"
Once the program is called and its command line interface is opened, 'cmd1', 'cmd2' and then 'exit' are entered sequentially.
I actually thought that the 'comm' parameter, used above, was a bash builtin function or something but it is not, because the following also works:
Code:
program infile outfile "cmd1 && cmd2 && exit"
So now, Im really confused. I dont understand why the declaration 'comm=...' works as input to the program interface, or why just giving the quoted string with logical && operators works? Can any you explain the semantics of this and what exactly bash is "thinking" when it does it?
Thanks all