Jump to content

Run Shell Script ( shellScript )


This topic is 4918 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Am I not understanding how "Run Shell Script ( shellScript )" should work under windows? I put in "echo hello world" and I got errors. I then put in ipconfig and filemaker froze completely is there more to this command than I think? Note: I'm on window 7 64-bit if that makes a difference. Below is the error for the echo:

java.io.IOException: Cannot run program "echo": CreateProcess error=2, The system cannot find the file specified



Parameters:

{shellScript=echo Hello}



---Script---

Script:

String[] commands = tokenize( shellScript );



Process process = Runtime.getRuntime().exec( commands );

process.waitFor();



exitValue = process.exitValue();

outputResult = process.getInputStream().getText("utf-8");

errorResult = process.getErrorStream().getText("utf-8");

if (exitValue != 0)

	throw new Exception(errorResult);

return outputResult;



public static String[] tokenize( String input ) {

	input = input.trim();

	String token, nextDelim = "t "";

	StringTokenizer st = new StringTokenizer(input, nextDelim, true );

	List result = new LinkedList();

	while( st.hasMoreTokens() ) {

		String lastValue = "";

		while( true ) { //Loop until a word is found

			token = st.nextToken( nextDelim );

			if( """.equals( token ) ) {

				if( """.equals( nextDelim ) ) break; //This is the closing quote

				else nextDelim = """; //This is the opening quote

			} else if( " ".equals( token ) || "t".equals( token ) ) {

				if( lastValue.length() > 0 ) break;

			} else if( "".equals( token ) ) {

				i...

Edited by Guest
Link to comment
Share on other sites

This topic is 4918 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.