Re: ?? exec prog << value ??
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 May 2007 19:37:05 GMT
Zeh Mau wrote:
On 31 Mai, 20:49, cla...@xxxxxxxxx (Cameron Laird) wrote:In article <DDD7i.6794$C96.2...@xxxxxxxxxxxxxxxxxxxxxxxxxx>,
Bryan Oakley <oak...@xxxxxxxxxxxxxxxxxxxx> wrote:
Zeh Mau wrote:>from the command line.Hello comp.lang.tcl !!!Show us the complete and actual error message, as well as the exact line
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.
of code. Otherwise we can only guess.
In addition, also tell us what happens when you do "echo '2+2' | prog"
.
.
.
Possible variations that occur to me:
exec prog << $var
exec prog << $var\n
I can easily imagine, though, that
exec prog << var
tosses an exception.
Hello Cameron,
you are right, I expected your second possibility also to be the right
version,
but the prog rises an error "syntax error",
which means the expression of $var\n is not a mathematical expression
like 2+2,
so the prog refuses it.
Perhaps I have a misunderstanding and it is not possible to start a
program
and give to him the information not over sdtin but by a variable.
It is absolutely possible. Your code has a bug.
If you want better help, give us better information. Show us the *exact* tcl code you are using and the *exact* error message and we might be able to help you more.
Often, people make assumptions about their code which are false but we can't see the code so we must go on the description that is given to us. If you can show us the actual tcl code and actual error it might shed light on the problem.
--
Bryan Oakley
http://www.tclscripting.com
.
- Follow-Ups:
- Re: ?? exec prog << value ??
- From: Zeh Mau
- Re: ?? exec prog << value ??
- References:
- ?? exec prog << value ??
- From: Zeh Mau
- Re: ?? exec prog << value ??
- From: Bryan Oakley
- Re: ?? exec prog << value ??
- From: Cameron Laird
- Re: ?? exec prog << value ??
- From: Zeh Mau
- ?? exec prog << value ??
- Prev by Date: Re: ?? exec prog << value ??
- Next by Date: Re: image-gif
- Previous by thread: Re: ?? exec prog << value ??
- Next by thread: Re: ?? exec prog << value ??
- Index(es):
Relevant Pages
|