home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / languages / tcl / !tcldoc / movedoc < prev    next >
Text File  |  1996-01-17  |  531b  |  26 lines

  1. # Move doc files from tar file to !tcldoc
  2.  
  3. #puts "Input directory?"
  4. #gets stdin in
  5.  
  6. set in "SCSI::Part2.$.Downloads.tcl74tar.tcl7/4.doc"
  7. set out "SCSI::Part0.$.TclDist.!tcldoc.doc"
  8.  
  9. proc move {ext dir}\
  10.  { global in out
  11.    set n [expr [string length $ext]+2]
  12.    set files [glob $in.*/$ext]
  13.    set leaves ""
  14.    foreach f $files \
  15.    { lappend leaves [string range $f 0 [expr [string length $f]-$n]]
  16.    }
  17.    foreach l $leaves \
  18.    { set s  "copy $in.$l/$ext $out.$dir.$l ~CV"
  19.      puts $s
  20.      system $s
  21.    }
  22.  }
  23.  
  24. move n Tcl
  25. move 3 C
  26.