passing args to exec 
Author Message
 passing args to exec


Quote:
>Can any one tell me how to use exec to run a different C program,
>but not lump all of the arguments into one argument.

                        .
                        .
                        .
Quote:
>So how can I do this so that all of my arguments end up in different
>"argv[] slots ?"

                        .
                        .
                        .
[eval exec command $your_arg_list]

<URL: http://www.*-*-*.com/ ~claird/comp.lang.tcl/fmm.html#exec>
--

Cameron Laird           http://www.*-*-*.com/ ~claird/home.html



Mon, 13 Mar 2000 03:00:00 GMT  
 passing args to exec

Can any one tell me how to use exec to run a different C program,
but not lump all of the arguments into one argument.
For example, at the shell prompt I can type:
        myexec -i 1 -p 2 ...
and my program runs fine.  But I've written a tcl script to do this
becasue the values for the parameters are comming out of a database.

 so I do this:

        set args "-i $ival -p $pval"
        exec myexec $args
 and it doesn't work, because the shell isn't there parsing everything
for me.  
So how can I do this so that all of my arguments end up in different
"argv[] slots ?"

Thanks



Mon, 13 Mar 2000 03:00:00 GMT  
 passing args to exec


Quote:
>Can any one tell me how to use exec to run a different C program,
>but not lump all of the arguments into one argument.
>For example, at the shell prompt I can type:
> myexec -i 1 -p 2 ...
>and my program runs fine.  But I've written a tcl script to do this
>becasue the values for the parameters are comming out of a database.

> so I do this:

> set args "-i $ival -p $pval"
> exec myexec $args

Try:

    eval exec myexec $args

****************************************************************************
* Gerald W. Lester                       | Voice:  +1 (504)-889-2784       *
* Computerized Processes Unlimited, Inc. | FAX:    +1 (504)-889-2799       *

* Metairie, LA 70001                     | Web:    http://www.cpu.com      *
****************************************************************************



Tue, 14 Mar 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. A question about passing args to exec

2. Passing args to an exec program

3. Problem: args don't pass at exec (tkcvs)

4. passing weird args through exec

5. Are method args pass-by-value or pass-by-reference

6. exec command with args

7. exec program with args doesn't work

8. exec'ing a command which has [] in the args

9. exec args

10. How to pass multible args to main

11. passing data/info/args to other programs....

12. Passing args to DLL - How Many?

 

 
Powered by phpBB® Forum Software