Problems with system() call.

조회 수: 2 (최근 30일)
Clark
Clark 2014년 9월 4일
답변: Clark 2014년 9월 12일
This is breaking our production runs, thanks for the help.
We have R2013b executing on Ubuntu 14.04:
Linux kashmir 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:51:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Our job chokes on the empty 'user' variable:
>> [status, user] = system( 'echo -n $DB_FULL_USER' )
status =
0
user =
''
Ooops, next time we make the call we get an erroneous doublet:
>> [status, user] = system( 'echo -n $DB_FULL_USER' )
status =
0
user =
matlabmatlab
Then on the next call we go back to normal for a 'while':
>> [status, user] = system( 'echo -n $DB_FULL_USER' )
status =
0
user =
matlab
The painful thing is that this is years old code, never broke before. AFAIK it's intermittent. Very strange, and I don't know what to do about it other than to loop on system(), but that seems crazy. Anybody have any idea what's happening?
THANK YOU
Clark

답변 (1개)

Clark
Clark 2014년 9월 12일
This post appears to be related:
Here we find that:
map = java.lang.System.getenv();
seems to be the means used by getenv() to attain its results.
whereas:
[ status, blahVal ] = system( 'echo -n $BLAH' )
could not "possibly" be using java. We're going to try switching our usage to getenv(). A few more days and we'll know if it's any better.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by