필터 지우기
필터 지우기

unix/system comand Always print out some environment setting when using it

조회 수: 1 (최근 30일)
ruth wang
ruth wang 2022년 6월 30일
댓글: ruth wang 2022년 7월 4일
When I use the command unix or system, it will always print out some settings in the screen, it really bothers me. Could anyone help me?
The first line following my command is not what I want. See these pictures for illustration. Thanks advance! Thank you very much!
  댓글 수: 2
Jonas
Jonas 2022년 6월 30일
편집: Jonas 2022년 6월 30일
what happens if you use the system with output variables [a,b]=system('pwd')
ruth wang
ruth wang 2022년 7월 4일
It will display nothing if I use [a,b]=system('pwd').
I found that it was because I used 'echo' in my cshrc file. After comment it, it fixes the problem and works fine as usual. Thank you anyway.

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

답변 (1개)

Jan
Jan 2022년 6월 30일
% Without semicolon:
system('pwd')
/users/mss.system.JTsOMg
ans = 0
% With semicolon:
system('pwd');
/users/mss.system.JTsOMg
% With semicolon and catching outputs:
[status, out] = system('pwd');
disp('ready')
ready
The last version helps.
  댓글 수: 1
ruth wang
ruth wang 2022년 7월 4일
I solved this problem by comment 'echo' in my unix environment setting. Thank you very much.

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

카테고리

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