|
From: | Jani Monoses |
Subject: | Re: [Gnu-arch-users] Example: renaming files and files references within arch |
Date: | Thu, 9 Sep 2004 18:28:40 +0300 |
> Here's how I solved a need to rename and re-reference a bunch of files > managed by tla. I wanted to rename all my ".tmpl" files to ".html". The > files needed to be moved on the file system, and all code references to > ".tmpl" updated. Here's how I did it: > > # 1. Find all files named .tmpl and rename them to .html > for f in `find html_root -name '*.tmpl'`; { > tla mv $f `perl -e '($p) = $ARGV[0]; $p =~ > s/(.*)\/([\w\-]+).tmpl/$1\/$2.html/; print $p' $f` ; > } you could use rename(1)
[Prev in Thread] | Current Thread | [Next in Thread] |