1. What am I doing wrong with System_exec?

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.

new topic     » topic index » view message » categorize

2. Re: What am I doing wrong with System_exec?

Do you suppose "say" requires an end-of-line marker after the text? like ("say " & text & "\n",2) or something?

new topic     » goto parent     » topic index » view message » categorize

3. Re: What am I doing wrong with System_exec?

tiger0581 said...

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.

new topic     » goto parent     » topic index » view message » categorize

4. Re: What am I doing wrong with System_exec?

jimcbrown said...
tiger0581 said...

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: What am I doing wrong with System_exec?

jeremy said...
jimcbrown said...
tiger0581 said...

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu