This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: dejagnu help: spawning with arguments, running ar
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Benjamin Kosnik'" <bkoz at redhat dot com>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 12 Jun 2006 18:03:53 +0100
- Subject: RE: dejagnu help: spawning with arguments, running ar
On 09 June 2006 17:52, Benjamin Kosnik wrote:
>> Ok, how's that meant to work?!? I don't see anything that suggests you
>> can just invoke arbitrary executables from an expect script; it's not a
>> shell script.
>
> Yes.... I said "naive." I was hoping to lure dejagnu hackers out of the
> woodwork with it.
>
:) IHBT!
>> eventually see that you need to build up your command line and wrap it in
>> a construct like
>>
>> set result [catch "eval spawn \{${commandline}\}" pid];
>
> This was helpful, thanks.
>
>> Isn't "Just append them to the commandline that gets spawned" the answer
>> you're looking for?
>
> Any chance I could get a pointer from you (like above), or even better
> a simple example?
Well, in your example from your earlier post, you would have wanted
something like
set commandline "./pair.exe"
if { some condition }
{
set commandline "$commandline 1 1000 2"
}
set result [catch "eval spawn \{${commandline}\}" pid];
..is that what you mean? The commandline to spawn is basically a shell
command line, you can use redirection and so on, although there are problems
with full pipelines. Take a look at local_exec in
${prefix}/share/dejagnu/remote.exp and particularly the warnings and caveats
in the comments at the start.
cheers,
DaveK
--
Can't think of a witty .sigline today....