Re: ?? exec prog << value ??



On May 31, 9:53 pm, Zeh Mau <chefmue...@xxxxxx> wrote:

set var 4+4\n
puts $var
set result [exec test_prog << $var]
puts $result
-----------------------------------------
4+4

syntax error
can't read "result": no such variable

Very strange. Either test_prog exits with status 0 and result gets set
to something (be it an empty string), or it exits abnormally, and
[exec] raises an exception, hence cannot reach the [puts].

Can you please run strace (I mean "strace tclsh example.tcl") and post
the output ?

-Alex

.



Relevant Pages

  • 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 ... The error message now is: ...
    (comp.lang.tcl)
  • Re: ?? exec prog << value ??
    ... the file contains the following commands: ... puts $result ... The message "syntax error" is created by ...
    (comp.lang.tcl)
  • Re: Error when running script
    ... Directory Path ... I was going to add an attachment to show that the directory really exits ... puts my_path + fl ...
    (comp.lang.ruby)
  • Re: Error when running script
    ... Directory Path ... I was going to add an attachment to show that the directory really exits ... puts my_path + fl ...
    (comp.lang.ruby)
  • I upgraded Expect and now "debug 1" doesnt work
    ... the script just exits when it sees the ... dbg1.0> [user@mach tmp]$ ...
    (comp.lang.tcl)