C#代码
  1. #!/bin/bash  
  2. if [ ! -n "$1" ] ;then  
  3.         echo "Error: you have not input a word!"  
  4.         ##### if [ $1 == "start" ] #######  
  5. elif [ $# -lt 2 ] ; then  
  6.         echo "Error: number of parameters!"  
  7. else  
  8.         #echo "Error: the word you input is $1"  
  9.         if [[ ! -d "$1" ]]; then    
  10.                 mkdir "$1"  
  11.                 echo "Error: Directory does not exist $1"  
  12.         elif [[ ! -d "$2" ]]; then  
  13.                 mkdir "$1"  
  14.                 echo "Error: Directory does not exist $2"  
  15.         else  
  16.                 echo -e "=============== [www.cnmo.com] ================"  
  17.                 ##### SubmitTime #######  
  18.                 if [ ! -n "$3" ] ;then  
  19.                     #echo "you have not input a word!"  
  20.                     svntime=''  
  21.                 else  
  22.                     #echo "the word you input is $1"  
  23.                     minx=$[ $3 * 60 ]  
  24.                     #seldate=`-mtime $minx`  
  25.                     seldate='-mmin -'$minx  
  26.                 fi  
  27.                 #find $1 -type f -mtime 0 \( -name '*css' -or -name '*js' \) -printf "%P\n" | while read file #按时间  
  28.                 find $1 -type f $seldate \( -name '*css' -or -name '*js' \) -printf "%P\n" | while read file #按全部  
  29.                 do  
  30.                         ##### mkdir path #######  
  31.                         npath=${file%/*}  
  32.                         if [[ ! -d "$npath" ]]; then  
  33.                                 mkdir -p "$npath"  
  34.                         fi  
  35.                         #strA="helloworld"  
  36.                         #strB="tpl"  
  37.                         #if [[ $file =~ $strB ]]  
  38.                         #then  
  39.                         #  echo "包含"  
  40.                         #else  
  41.                         #  echo "不包含"  
  42.                         #fi  
  43.   
  44.                         if [[ $file =~ "tpl" ]]  
  45.                         then  
  46.                           echo "目录: "$file" 包含/tpl/直接略过.."  
  47.                         else  
  48.                                 ##### start yui #######  
  49.                                 dfile=$1"/"$file  
  50.                                 nfile=$2"/"$file  
  51.                                 yjar=/jar/yuicompressor-2.4.7.jar  
  52.                                 if [ "${file##*.}" = "css" ]; then  
  53.                                         java -jar $yjar --type css --charset gb2312 $dfile -o $nfile  
  54.                                         echo -e "ok[==>css]:"$nfile  
  55.                                 elif [ "${file##*.}" = "js" ]; then  
  56.                                         java -jar $yjar --type js --charset gb2312 $dfile -o $nfile  
  57.                                         #java -jar /jar/yuicompressor-2.4.2.jar --type js --charset gb2312 /data/svnroot/jenkins_SVN_data/old/origin/touch/315j.js -o /test/origin/touch/315j.js  
  58.                                         echo -e "ok[==>js]:"$nfile  
  59.                                 fi  
  60.                         fi  
  61.                 done  
  62.         fi  
  63. fi  
C#代码
  1. java -jar /jar/yuicompressor-2.4.2.jar --type js --charset gb2312 /data/svnroot/jenkins_SVN_data/old/origin/touch/315j.js -o /test/origin/touch/315j.js  
find / -amin -10 # 查找在系统中最后10分钟访问的文件
find / -atime -2 # 查找在系统中最后48小时访问的文件

find / -mmin -5 # 查找在系统中最后5分钟里修改过的文件
find / -mtime -1 #查找在系统中最后24小时里修改过的文件
Linux/Unix | 评论(0) | 引用(0) | 阅读(346)