Change shell used by matlab

조회 수: 20 (최근 30일)
Quan Zhou
Quan Zhou 2016년 11월 18일
답변: Quan Zhou 2016년 11월 18일
I somehow run into a situation that a copyfile() is done through by my default $SHELL, which is /usr/local/bin/fish, which is out of the scope of the authors assumption, and the execution chokes on:
Error using copyfile
fish: Unknown command ' -r -p -f /Applications/MATLAB_R2016b.app/toolbox/matlab/guide/guitemplates/guidetemplate0.fig
I tried to
setenv SHELL /usr/local/bin/bash
but that doesn't work.
I dug through several docs on startup.m but none of them mentioned how can I specify another shell.
Hints?
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 18일
Is there a space or shell metacharacter in the filename you are copying from?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 18일
"On UNIX, MATLAB uses a shell program to execute the given command. It determines which shell program to use by checking environment variables on your system. MATLAB first checks the MATLAB_SHELL variable, and if either empty or not defined, then checks SHELL. If SHELL is also empty or not defined, MATLAB uses /bin/sh."

추가 답변 (1개)

Quan Zhou
Quan Zhou 2016년 11월 18일
Thanks!
I used
launchctl setenv MATLAB_SHELL /bin/bash
and it all works fine now!

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by