Re: ?? exec prog << value ??



Ok, I have a file called example.tcl

the file contains the following commands:

-----------------------------------------
set var 4+4\n

puts $var

set result [exec test_prog << $var]

puts $result
-----------------------------------------

The output is:
-----------------------------------------
4+4

syntax error
can't read "result": no such variable
-----------------------------------------
The message "syntax error" is created by
test_prog when there is no mathematical expression.

Thanks for your help,
Zeh Mau

.



Relevant Pages

  • Re: ?? exec prog << value ??
    ... puts $result ... The message "syntax error" is created by ... if you run it from the command line you will get the same error. ...
    (comp.lang.tcl)
  • Re: Whitespace matters in instance_eval? Im confused
    ... :2: syntax error ... :2: parse error, unexpected tSTRING_BEG, expecting kDO or '{' or '(' ... {puts "boom"} ...
    (comp.lang.ruby)
  • Re: and and or in case
    ... but why the difference in precedence for case-when and if? ... puts "OK!" ... syntax error, unexpected kAND, expecting kTHEN or ':' or '\n' or ';' ... test.rb:9: syntax error, unexpected kEND, expecting $end ...
    (comp.lang.ruby)
  • Re: ?? exec prog << value ??
    ... puts $result ... Either test_prog exits with status 0 and result gets set ... Can you please run strace (I mean "strace tclsh example.tcl") and post ...
    (comp.lang.tcl)
  • Re: Syntax error with blocks
    ... :150: syntax error, unexpected '}', expecting $end ... irb:158:0> do puts 'foo' end ...
    (comp.lang.ruby)