1. What am I doing wrong with System_exec?
- Posted by tiger0581 Sep 05, 2009
- 1105 views
- Last edited Sep 06, 2009
Hello. What is wrong with the following line? error_code=system_exec("say "&text,2) Text is the variable with text I want to pass to the Mac OS 10 "say" command.
Sh gives me the following error when I run the Euphoria program with that line: sh: -c: line 1: syntax error: unexpected end of file Thanks.
2. Re: What am I doing wrong with System_exec?
- Posted by irv Sep 05, 2009
- 1080 views
- Last edited Sep 06, 2009
Do you suppose "say" requires an end-of-line marker after the text? like ("say " & text & "\n",2) or something?
3. Re: What am I doing wrong with System_exec?
- Posted by jimcbrown (admin) Sep 06, 2009
- 1168 views
Hello. What is wrong with the following line? error_code=system_exec("say "&text,2) Text is the variable with text I want to pass to the Mac OS 10 "say" command.
Sh gives me the following error when I run the Euphoria program with that line: sh: -c: line 1: syntax error: unexpected end of file Thanks.
What is the contents of text?
Probably it has a quote or brace in it that needs to be escaped.
4. Re: What am I doing wrong with System_exec?
- Posted by jeremy (admin) Sep 06, 2009
- 1169 views
Hello. What is wrong with the following line? error_code=system_exec("say "&text,2) Text is the variable with text I want to pass to the Mac OS 10 "say" command.
Sh gives me the following error when I run the Euphoria program with that line: sh: -c: line 1: syntax error: unexpected end of file Thanks.
What is the contents of text?
Probably it has a quote or brace in it that needs to be escaped.
This is my guess to. As a quick test do:
sequence text = "hello" ? system_exec("say " & text, 2)
See if that works. If so, escaping is indeed your problem.
Jeremy
5. Re: What am I doing wrong with System_exec?
- Posted by tiger0581 Sep 06, 2009
- 1102 views
Hello. What is wrong with the following line? error_code=system_exec("say "&text,2) Text is the variable with text I want to pass to the Mac OS 10 "say" command.
Sh gives me the following error when I run the Euphoria program with that line: sh: -c: line 1: syntax error: unexpected end of file Thanks.
What is the contents of text?
Probably it has a quote or brace in it that needs to be escaped.
This is my guess to. As a quick test do:
sequence text = "hello" ? system_exec("say " & text, 2)
See if that works. If so, escaping is indeed your problem.
Jeremy
Thanks. Escaping was the problem. The text is from an HTML page, so it had a quotation mark.