Functions.common.sh 306 Bytes
Newer Older
据说甜蜜呢 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/bash

set -e

function ToLower()
{
   declare input=$1
   declare output=($(echo "${input}" | tr 'A-Z' 'a-z'))
   eval $2=${output}
}

function Replace()
{
  declare input=$1
  declare sourceExpr=$2
  declare targetExpr=$3
  declare output=${input//${sourceExpr}/${targetExpr}}
  eval $4=${output}
}