title: Unity c# run shell script
body: <p>Using Unity3D and from editor script trying to run a script in the terminal on osx.</p>
  
  <p>When running test.sh from terminal the GDCL application does its thing and then outputs the arguments. But if I run the script from Unity3D editor I only get the arguments in the output. GDCL doesn't run.</p>
  
  <p><strong>How can I get Unity3D to run terminal scripts?</strong></p>
  
  <p>C# script that runs test.sh <em>(gives only output)</em></p>
  
  <pre><code>ProcessStartInfo psi = new ProcessStartInfo(); 
  psi.FileName = Application.dataPath+"/test.sh";
  psi.UseShellExecute = false; 
  psi.RedirectStandardOutput = true;
  psi.Arguments = "arg1 arg2 arg3";
  
  //psi.Arguments = "test"; 
  Process p = Process.Start(psi); 
  string strOutput = p.StandardOutput.ReadToEnd(); 
  p.WaitForExit(); 
  UnityEngine.Debug.Log(strOutput);
  </code></pre>
  
  <p>The test.sh script has chmod 777 <em>(GDCL works only from terminal)</em></p>
  
  <pre><code>#!/bin/sh
  GDCL ~/Documents/Unity/testproject/Assets/Font\ Normal.GlyphProject ~/Documents/Unity/testproject/Assets/Textures/fontNormal/font -fo PlainText-txt
  for arg in $*
  do
      echo $arg
  done
  </code></pre>