home *** CD-ROM | disk | FTP | other *** search
- .k file/A,as/A
- .bra {
- .ket }
- ;; REN -- Extended renaming of multiple
- ;; files.
- ;; (Note that Directories are deliberately excluded (FILES mode, not DIRS)
- ;; to avoid the possibility of eating oneself...; multiple directory
- ;; renames aren't often needed anyway, but you can change it if you want.)
-
- mat key "#?'^#?" "{as}" ;; if there are no markers in the template
- ;; just use standard rename:
- if warn
- rename "{file}" as "{as}"
- else
- run mat >t:_ren f "cd ^Q^D^Q^Brename ^Q^F^Q as ^Q{as}^Q" "{file}" +
- execute t:_ren +
- delete t:_ren
- endif
-
- ;; this script itself creates a subsidiary script ("T:_ren") to do the
- ;; renaming work; this will contain two lines for each matching file
- ;; to be renamed: the first is a CD to the directory, the second is the
- ;; constructed rename command for that file.
- ;;; NOTE that a PIPE: would NOT be a safe way to do it!
- ;;; (you might end up (re)cursing violently!)
-