zoukankan      html  css  js  c++  java
  • Batch the files in the directory

    #!/bin/bash
    #sourceFolder = /home/bigdatagfts/pl62716/refdata
    #targetFolder = /home/bigdatagfts/pl62716/refdata_target
    sourceFolder=$1
    targetFolder=$2
    if [ $# != 2 ] ; then 
        echo "USAGE: $0 sourceFolder hdfsFolder" 
        echo " e.g.: $0 /home/bigdatagfts/pl62716/refdata /home/bigdatagfts/pl62716/refdata_target" 
        exit 1; 
    fi
    if [ ! -d "$sourceFolder" ];then
        echo "$sourceFolder is not exist, please check!"
        exit 1;
    else
        if [ ! -d "$targetFolder" ];then
            echo "$targetFolder is not exist! create $targetFolder !"
            mkdir -p "$targetFolder"
            
        fi
    fi
    echo "delete lines which begin with H/T and store to dir $targetFolder" 
    cd $sourceFolder
    for file in `ls`
        do
            if test -f $file
            then 
                if [ -f "$targetFolder/$file" ]; then 
                    rm $targetFolder/$file
                fi
                sed '/^H|^T/'d $file | cat -n > $targetFolder/$file
            fi
        done
  • 相关阅读:
    数组
    css动画
    mui 常用手势
    ejs 用到的语法
    css 高度塌陷
    SQL 用到的操作符
    position: relative;导致页面卡顿
    h5 图片生成
    li之间的间隙问题
    虚拟机扩容mac
  • 原文地址:https://www.cnblogs.com/liupuLearning/p/7049492.html
Copyright © 2011-2022 走看看