linux下文件字符的替换脚本

#! /bin/sh                                                                                                                                                                               

func_loop()
{
    for file in $1/*
    do
        if [ -f $file ]
        then
            perl -pi -e 's/^M//g' "$file"
#           perl -pi -e 's/\s+$/\n/g' "$file"
            perl -pi -e 's/DEBUG_INFO/EFI_D_INFO/g' "$file"
            perl -pi -e 's/DebugPrint/DbgPrint/g' "$file"
            perl -pi -e 's/DEBUG/DBGPRINT/g' "$file"
        else
            func_loop $file
        fi
    done

}
func_loop .

猜你喜欢

转载自blog.csdn.net/Lq19880521/article/details/80538234