<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>host</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="host"> Unix or DOS command execution</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>stat=host(command-name)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>command-name</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: A character string containing Unix sh instruction</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>stat</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: An integer flag</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Sends a string <VERB>command-name</VERB> to Unix for execution by the command interpreter (sh under Unix, or command.com under DOS). Standard output and standard errors of the shell command are written in the calling shell.
    <VERB>stat</VERB> gives -1 if host can't be called (Not enough system memory
    available) or the command interpreter return code.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
    //create a getdir function based on host
    function wd=getdir()
      if MSDOS then 
        host('cd>'+TMPDIR+'\path');
      else
        host('pwd>'+TMPDIR+'/path');
      end
      wd=read(TMPDIR+'/path',1,1,'(a)')
    endfunction
    //call it
    wd=getdir()
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>edit</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>manedit</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>unix_g</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>unix_s</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>unix_w</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>unix_x</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
