Using Unity3D and a script editor trying to run a script in an osx terminal.
When running test.sh from the terminal, the GDCL application does its job and then outputs the arguments. But if I run the script from the Unity3D editor, I only get the arguments in the output. GDCL does not start.
How can I get Unity3D to run terminal scripts?
C # script that runs test.sh (gives only output)
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);
There is chmod 777 in test.sh script (GDCL only works from the terminal)
#!/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
source share