#!/bin/bash csstmpl_path= "/home/fdipzone/php/csstmpl" css_path= "/home/fdipzone/php/css" replacetags= (". png") ". jpg" ". gif") convertnum=0 search_child=$1 echo ${search_child:=0} >/dev/null function Create () {tmplfile=$1 dfile=$2 css_content=$ (cat $tmplfile) dfolder=${dfile%/*} if [! -D "$dfolder"]; Then mkdir-p $dfolder fi for tag in ${replacetags[*]};
Do newtag= "$tag $ (date +%y%m%d%h%m%s)" css_content=${css_content//$tag/$newtag} done echo $css _content > $dfile convertnum=$ (($convertnum + 1)) Tolog "$tmplfile Convert to $dfile Success '} function Tolog () {echo} function update () {if [-D "$csstmpl _path"] &am p;& [D "$css _path"]; Then if ["$search _child"-eq 0]; Then maxdepth= "-maxdepth 1" Else maxDo dfile=${file/$csstmpl _path/$css _path} create $file $dfile done E
Cho "Convert num: $convertnum else Tolog" $csstmpl _path or $css _path not exists "fi}" Update Exit 0
PHP Version: http://blog.csdn.net/fdipzone/article/details/8570525
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/