Bash 替换文件内容的函数

#!/usr/bin/env bash
#替换文件内容的功能
set -e;

SED_FILE(){
  local SRC=${1}
  local TAG=${2}
  local FILE=${3}
  set -x
  sed -i "s#${SRC}#${TAG}#g" ${FILE};
  set +x
}

Leave a Reply

Your email address will not be published. Required fields are marked *