diff --git a/src/bash-utils.sh b/src/bash-utils.sh index 9999015..e2f170f 100755 --- a/src/bash-utils.sh +++ b/src/bash-utils.sh @@ -157,7 +157,7 @@ LIST=$1 VALUE=$2 for item in ${LIST}; do - RES=`echo "${VALUE}" | sed "s/${item}/1/"` + RES=`echo "${item}" | sed "s/${VALUE}/1/"` if [ "${RES}" = "1" ]; then return 1 fi diff --git a/src/bash-utils.sh b/src/bash-utils.sh index 9999015..e2f170f 100755 --- a/src/bash-utils.sh +++ b/src/bash-utils.sh @@ -157,7 +157,7 @@ LIST=$1 VALUE=$2 for item in ${LIST}; do - RES=`echo "${VALUE}" | sed "s/${item}/1/"` + RES=`echo "${item}" | sed "s/${VALUE}/1/"` if [ "${RES}" = "1" ]; then return 1 fi diff --git a/test/test_bash-utils.sh b/test/test_bash-utils.sh index a861e21..f90f8fb 100755 --- a/test/test_bash-utils.sh +++ b/test/test_bash-utils.sh @@ -184,7 +184,7 @@ function test_isContainsRegex() { LIST="abc def gef" - isContainsRegex "abc def ghi" "g?i" + isContainsRegex "abc def ghi" "g.i" RESULT=$? assertEquals "isContains [含まれるリスト確認]" "1" "${RESULT}" } @@ -197,7 +197,7 @@ function test_isContainsRegex_noContains() { LIST="abc def gef" - isContainsRegex "abc def ghj" "g?i" + isContainsRegex "abc def ghj" "g.i" RESULT=$? assertEquals "isContains [含まれないリスト確認]" "0" "${RESULT}" }