SYSTEM_CMD: issue system commands, and try to compensate for strange differences between systems. status = system_cmd( cmd );
0001 function [status,result] = system_cmd( cmd ) 0002 % SYSTEM_CMD: issue system commands, and try to compensate for 0003 % strange differences between systems. 0004 % 0005 % status = system_cmd( cmd ); 0006 0007 % (C) 2012 Andy Adler, License GPL v2 or v3 0008 % $Id: system_cmd.m 4170 2013-06-11 18:49:27Z bgrychtol $ 0009 0010 if ~exist('OCTAVE_VERSION') 0011 if strfind(system_dependent('getos'),'Linux') 0012 %Version 7 under linux sets the LD_LIBRARY_PATH and that breaks netgen 0013 ldpath ='LD_LIBRARY_PATH=;'; 0014 % Problems are a) some newer matlab versions dont' need it, 0015 % b) what if people are working in tcsh? 0016 0017 cmd = ['sh -c ''LD_LIBRARY_PATH=""; ',cmd,' '' ']; 0018 end 0019 end 0020 if eidors_debug('query','system_cmd') 0021 disp(cmd); 0022 end 0023 [status,result] = system(cmd,'-echo'); 0024