Re: TCL, UNIX, [exec] and lists
From: Paul Pluzhnikov (ppluzhnikov-nsp_at_charter.net)
Date: 01/01/04
- Next message: Michael Heiming: "Re: Sendmail connection refused"
- Previous message: Michael W. Cocke: "Re: Sendmail connection refused"
- In reply to: Phil Powell: "TCL, UNIX, [exec] and lists"
- Next in thread: Gerald Lester: "Re: TCL, UNIX, [exec] and lists"
- Reply: Gerald Lester: "Re: TCL, UNIX, [exec] and lists"
- Reply: Phil Powell: "Re: TCL, UNIX, [exec] and lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Dec 2003 15:02:53 -0800
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,
-- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email.
- Next message: Michael Heiming: "Re: Sendmail connection refused"
- Previous message: Michael W. Cocke: "Re: Sendmail connection refused"
- In reply to: Phil Powell: "TCL, UNIX, [exec] and lists"
- Next in thread: Gerald Lester: "Re: TCL, UNIX, [exec] and lists"
- Reply: Gerald Lester: "Re: TCL, UNIX, [exec] and lists"
- Reply: Phil Powell: "Re: TCL, UNIX, [exec] and lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|