exec ls -l vs. exec "ls -l" 
Author Message
 exec ls -l vs. exec "ls -l"

I've been trying without much luck to get exec to execute a multi-word
string, for example:

proc func {command} {
        exec $command

Quote:
}

func {ls -l}

exec tries to execute "ls -l" as one word, instead of the two words. I
cannot figure out how to get exec to execute the string. In the above
example, func {uptime} would work, otherwise it says "cannot find
whatever to execute. Any way around this?

- liem

--

Outside of a dog, computers are a man's best  | UCS Consulting
friend, inside a dog it's too dark to type.   | UW Ice Hockey/X-Phile
http://www.*-*-*.com/ ~roland         | Linux/WWW/tcl/tk/tkHTML



Wed, 04 Jun 1997 20:44:18 GMT  
 exec ls -l vs. exec "ls -l"

Quote:

>I've been trying without much luck to get exec to execute a multi-word
>string, for example:

>proc func {command} {
>    exec $command
>}

>func {ls -l}

>exec tries to execute "ls -l" as one word, instead of the two words. I
>cannot figure out how to get exec to execute the string. In the above
>example, func {uptime} would work, otherwise it says "cannot find
>whatever to execute. Any way around this?

Try:
        eval exec $command

==========================================================================
* Gerald W. Lester                        !   Voice:  (504)-889-2784     *
* Computerized Processes Unlimited        !   FAX:    (504)-889-2799     *

* Metairie, LA  70001                     !   Hours:  09:00-17:00 CDT    *
==========================================================================



Thu, 05 Jun 1997 01:50:54 GMT  
 exec ls -l vs. exec "ls -l"
...
: proc func {command} {
:       exec $command
: }

: func {ls -l}

: exec tries to execute "ls -l" as one word, instead of the two words.  
: Any way around this?

Try
     eval exec $command



Thu, 05 Jun 1997 13:08:04 GMT  
 exec ls -l vs. exec "ls -l"

: ...
: : proc func {command} {
: :     exec $command
: : }

: : func {ls -l}

: : exec tries to execute "ls -l" as one word, instead of the two words.  
: : Any way around this?

try
        proc func {args} {
                eval exec $args
        }

        func ls -l

Ioi.



Fri, 06 Jun 1997 18:10:00 GMT  
 exec ls -l vs. exec "ls -l"

: I've been trying without much luck to get exec to execute a multi-word
: string, for example:

: proc func {command} {
:       exec $command
: }

: func {ls -l}

 eval exec $command
--



Sun, 08 Jun 1997 05:03:26 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. exec "ls" in remote directory

2. "ls" of only hidden files

3. Enhancing "ls -l" file listing abilities

4. couldn't execute "ls": argument list too long

5. Read "ls" output into list variable

6. exec ls *.java does not work on Solaris ??

7. Need help with "exec ls -a" command on nt

8. exec sh -c "ls *.c" on NT with tcl/tk 8.0

9. Question about "SYSTEM EXEC" vi

10. exec ""? Insecure operation

11. Error with eruby: "Exec format error"

12. How to use DOS "Exec" function

 

 
Powered by phpBB® Forum Software