Shell sh update CSS picture version

Source: Internet
Author: User
#!/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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.