Re: TCL, UNIX, [exec] and lists
From: Phil Powell (soazine_at_erols.com)
Date: 01/02/04
- Next message: news.free.fr: "howto /etc/security/limits.conf under debian"
- Previous message: mjt: "Re: External serial modem recommendation needed."
- In reply to: Paul Pluzhnikov: "Re: TCL, UNIX, [exec] and lists"
- Next in thread: Donald Arseneau: "Re: TCL, UNIX, [exec] and lists"
- Reply: Donald Arseneau: "Re: TCL, UNIX, [exec] and lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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,
- Next message: news.free.fr: "howto /etc/security/limits.conf under debian"
- Previous message: mjt: "Re: External serial modem recommendation needed."
- In reply to: Paul Pluzhnikov: "Re: TCL, UNIX, [exec] and lists"
- Next in thread: Donald Arseneau: "Re: TCL, UNIX, [exec] and lists"
- Reply: Donald Arseneau: "Re: TCL, UNIX, [exec] and lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|