I am trying to get continued interaction with a command line window once I give an initial command. The command is:
system('start cygwinbatch.bat')
which contains:
::@echo off
C:\cygwin64\bin\bash -li /cygdrive/c/stp/stpscript.sh
This is to run the "stpscript.sh" which contains only one line, which runs stp.exe in the cygwin environment (which it requires). This all works properly, however stp has an in-command-line interface that requires additional input (it allows me to download seismic data to the current folder).
What I want to know is, can I make additional commands to that already opened window through MATLAB? Additional commands (with new lines) in MATLAB seem to just create new command line instances. STP takes about two seconds to become operational and ready for new commands once I open it, so if MATLAB will try to give it a flurry of inputs (as in open STP, then immediately try to download data) it may not work properly.
I was also thinking I could maybe add more lines to my .sh script with additional commands, containing what to download, but the information as to which data I need to access is all calculated within my MATLAB scripts. It would be a lot easier if I didn't have to continually rewrite my .sh file with the next dataset to download, and I could just give MATLAB a new command instead. So, can this be done?