[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sometimes Tcl is fabulous



hi - 

recently some folks have questioned the use of tcl, but i just did
something in <5 minutes that was pretty fantastic.  i had copied all the
header files from win32 to unix so i could access them more easily using
unix commands (e.g., grep).  {yes, i know about cygwin, but after
futzing for a day trying to set it up so i could edit and do what i am
used to doing on unix i still couldn't figure out a reliable way to run
things - so screw it, just copy the files.}

so, you know what happened, all the file names were capitalized -- my
fingers don't like capitalized file names.  i wrote a short tcl script
to rename all the files.  here it is:

---
foreach x [glob *] {
  catch {exec mv $x [string tolower $x]} errno
}
---

and viola, i have the files renamed.

yep, i know i could have done this with a shell script - but i know tcl
better than the shell.  

bottom line, scripting languages are wonderful and Tcl/Tk is much better
than people give it credit.

now, back to that damn win32 video grabber...
-- 
Professor Lawrence A. Rowe          Internet: Rowe@BMRC.Berkeley.EDU
Computer Science Division - EECS       Phone: 510-642-5117
University of California, Berkeley       Fax: 510-642-5615
Berkeley, CA 94720-1776            URL: http://bmrc.berkeley.edu/~larry