list of csh commands to be run from matlab script
조회 수: 4 (최근 30일)
이전 댓글 표시
I need to run a list of csh commands on the unix terminal from a matlab script.
Whenever I try to use the system() function, it gets into a infinite loop in the script (the control goes to the terminal in MATLAB.
Until I type the exit command in MATLAB terminal, the control does not go back to the script execution.
As the first line is csh, the rest of the line becomes useless.
I am not able to understand how to achieve this.
The list of commands are as follows:
csh
source /home/install/cshrc
setenv ...
setenv ...
{ some software specifc commands}
Thanks in advance
Aksh
댓글 수: 3
답변 (1개)
Bjorn Gustavsson
2020년 11월 19일
You might accidentally start a c-shell with your first csh command. My suggestion is that you put all csh-commands into a csh-script, and run that instead of uising matlab to making the list of commands to run. That seems cleaner. If you need to dynamically generate the commands, you should be able to save those to a csh-script (use system to set its permissions to executable) and run that script with system. This seems like a "cleaner" solution than yours, hopefully it works?
Wiki-book: C-shell-scripting
HTH
댓글 수: 2
Bjorn Gustavsson
2020년 11월 23일
Do I interpret your objective correctly: You want to start a programme/csh-script from matlab use the output of that programme to do some further processing and controll the running of the programme/csh-script from the results of that processing?
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!