フィルターのクリア

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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by