shell (sh) command execution
stat=unix(command-name)
:command-name A character string containing Unix sh instruction : :stat An integer flag :
Sends a string command-name to Unix for execution by the sh shell. Standard output and standard errors of the shell command are written in the calling shell. stat gives -1 if unix can’t be called (Not enough system memory available) or the sh return code.
if `getos`_() <> 'Windows' then
unix("ls $SCI/demos");
end
function wd=directory()
if `getos`_() == 'Windows' then
unix('cd>'+TMPDIR+'\path');
else
unix('pwd>'+TMPDIR+'/path');
end
wd=`read`_(TMPDIR+'/path',1,1,'(a)');
endfunction
wd=directory()