Problems with system() call.

2 visualizaciones (últimos 30 días)
Clark
Clark el 4 de Sept. de 2014
Respondida: Clark el 12 de Sept. de 2014
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

Respuestas (1)

Clark
Clark el 12 de Sept. de 2014
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.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by