You will for sure read the man page of Tcl's "clock" command. ;-)
mike
>Is there any way you can convert unix command with awk command in it to
>tcl
> command. I want to use the following command in my tcl script.
> >
> > set d = `date '+DATE:%m.%d.%y' | awk -F: ' { print $2 }'`
> >
> > I would appreciate any suggestion on how to do it.
set d [clock format [clock seconds] -format %m.%d.%y]
set d [exec date +DATE:%m.%d.%y | awk -F: {{print $2}}]
Note the lack of single quote characters, and the double curlies round
the `print $2'. Do not use this script as-is in a binding (but a proc
called by a binding is OK, and easier in the long run anyway)
Donal.
--
Donal K. Fellows http://r8h.cs.man.ac.uk:8000/ (SAY NO TO COMMERCIAL SPAMS!)
(work) fell...@cs.man.ac.uk Dept. Comp. Sci, Univ. Manchester, U.K.
| do...@ugglan.demon.co.uk 6,Randall Place, Heaton, Bradford, U.K. (home)
+-> ++44-161-275-6137 Send correspondence to my office ++44-1274-401017 <-+