Re: ?? exec prog << value ??



On 31 Mai, 19:31, Bryan Oakley <oak...@xxxxxxxxxxxxxxxxxxxx> wrote:
Zeh Mau wrote:
Hello comp.lang.tcl !!!

I have the following problem:

I have created a program with with flex and bison (lex, yacc),
a small calculator,
now i want to execute the program within a tcl-script.

Therefore I write

exec prog << var
where var shall be the mathematical expression, e.g. 2+2

Now I thought,
the prog will be executed and by using
<<
the value of var (string) 2+2 will be passed as input to prog.

Unfortunately, there is only
the message "syntax error" instead of - as i have expected - 4.

Show us the complete and actual error message, as well as the exact line
of code. Otherwise we can only guess.

In addition, also tell us what happens when you do "echo '2+2' | prog"
from the command line.

--
Bryan Oakleyhttp://www.tclscripting.com

In normal case,
I type prog then press return
then I type 2+2 and press return
the result is shown in the next line.

Whole procedure:
prog -> return
2+2 -> return
4.0000

I expexted when I write exec prog this is the same situation as
lcalc + return
the << implies that 2+2 will be passed as input for which the prog is
waiting
then the result is calculated by the prog and should be stored in a
new variable.

Zeh Mau

.



Relevant Pages

  • Re: ?? exec prog << value ??
    ... a small calculator, ... now i want to execute the program within a tcl-script. ... where var shall be the mathematical expression, ... the prog will be executed and by using ...
    (comp.lang.tcl)
  • file creation - unix
    ... i can execute a prog wich is set-uid. ... creat i think). ... the owner and mode are unchanged. ...
    (comp.os.linux.security)
  • Re: file creation - unix
    ... >i can execute a prog wich is set-uid. ... >creat i think). ... >to the effective uid of the process and permission is 600. ...
    (comp.os.linux.security)
  • Re: Launch and kill external executable
    ... I want to launch an external script or executable from a C prog, ... return the pid of the launched process. ... If you fork a child only to execute a program in it, ...
    (comp.unix.programmer)
  • Re: ?? exec prog << value ??
    ... a small calculator, ... now i want to execute the program within a tcl-script. ... the value of var 2+2 will be passed as input to prog. ...
    (comp.lang.tcl)