Re: Global File Change
| From: | Monte Ohrt | Date: | Wed, 02 May 2001 15:07:28 +0000 |
| Subject: | Re: Global File Change | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-663@lists.php.net to get a copy of this message | ||
yuck :-) I would leave them .tpl, so you can distinguish between html
and template files. This might cause more problems than help in the long
run.
Now to answer your question:
1) I have included a simple (perl) script here that does mass
search/replace in text files.
sr.pl [search_string or regex] [replace_string] file1 file2 file3 ...
(you can use wildcards for file names)
be careful with this one!
2) this will take a bit of scripting, unless you already have a script
that does it for you. (anyone?) basically, find all files ending in
.tpl, then mv to [part not .tpl].htm
Maybe something like this (ugly & untested)
cd /path/to/templates
for x in
ls *.tpl
do
mv $x echo $x | cut -f1 -d '.'.htm
done
jml@spectrum.net wrote:
>
> Thanks for providing Smarty, I tried all the other Template
> Engines, and Smarty makes the best sense to me, and has
> increased my productivity many times over.
>
> I have decided with the new version to change all my *.tpl
> files to *.htm files to make it easier for the designer's.
> I'm know I could spend some time researching this, but I was
> hoping someone could just provide an answer... I need to do
> 2 things Under Red Hat 7.0
>
> 1) How can I change all occurances of .tpl to .htm in my
> scripts?
>
> 2) How can I easily rename all *.tpl files to *.htm, would
> 'cp *.tpl *.htm' work?
>
> Thanks in Advance,
>
> Joe
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/