Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
ruth wang
ruth wang le 30 Juin 2022
Commenté : ruth wang le 4 Juil 2022
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 commentaires
Jonas
Jonas le 30 Juin 2022
Modifié(e) : Jonas le 30 Juin 2022
what happens if you use the system with output variables [a,b]=system('pwd')
ruth wang
ruth wang le 4 Juil 2022
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.

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 30 Juin 2022
% 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 commentaire
ruth wang
ruth wang le 4 Juil 2022
I solved this problem by comment 'echo' in my unix environment setting. Thank you very much.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by