Re: TCL, UNIX, [exec] and lists

From: Phil Powell (soazine_at_erols.com)
Date: 01/02/04


Date: 2 Jan 2004 07:18:17 -0800

That's exactly what I did and it works, of course. I still don't
understand why it works, could you explain it a bit more in detail for
me.

Yes, I know..

for {set i 1} {$i <= 500} {incr i} {
 puts "I will not mix string and list commands in TCL"
}

Happy now, people? :)

Phil

Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote in message news:<m38yks7fqa.fsf@salmon.parasoft.com>...
> soazine@erols.com (Phil Powell) writes:
>
> > exec tar zcf $tarFileName [string range $fileList 0 end]
>
> Since "[string range $a 0 end]" is by definition identical to $a,
> you might as well write this as
>
> exec tar zcf $tarFileName $fileList
>
> > It apparently thinks the file name is all of $fileList, it doesn't
> > seem to know that I am importing $fileList as a list of string values.
>
> Right.
>
> > TCL knows what it is, but TAR does not.
>
> TCL exec command will pass each argument separately (as if the values
> are single-quoted after the variable expansion). To make it do what
> you want, change it to:
>
> eval exec tar zcf $tarFileName $fileList
>
> Be careful not to have any spaces or TCL-special characters in
> either $tarFileName or $fileList.
>
> Cheers,



Relevant Pages

  • Re: TCL, UNIX, [exec] and lists
    ... puts "I will not mix string and list commands in TCL" ... > soazine@erols.com (Phil Powell) writes: ... > TCL exec command will pass each argument separately (as if the values ...
    (comp.unix.misc)
  • Re: TCL, UNIX, [exec] and lists
    ... puts "I will not mix string and list commands in TCL" ... > soazine@erols.com (Phil Powell) writes: ... > TCL exec command will pass each argument separately (as if the values ...
    (comp.lang.tcl)
  • Re: TCL equivalent of PHP "phpinfo()"?
    ... > Phil Powell wrote: ... > If you learned Tcl through Vignette's educational system no wonder ... They use a very odd implementation of Tcl and do a ... written "entirely in Story Server". ...
    (comp.lang.tcl)
  • Re: TCL, UNIX, [exec] and lists
    ... Paul Pluzhnikov wrote: ... > soazine@erols.com (Phil Powell) writes: ... > TCL exec command will pass each argument separately (as if the values ... > are single-quoted after the variable expansion). ...
    (comp.lang.tcl)
  • Re: TCL, UNIX, [exec] and lists
    ... Paul Pluzhnikov wrote: ... > soazine@erols.com (Phil Powell) writes: ... > TCL exec command will pass each argument separately (as if the values ... > are single-quoted after the variable expansion). ...
    (comp.os.linux.misc)