Я пишу средство проверки стиля кода в Ubuntu, это хорошая работа.но теперь я использую систему Windows 7.
В Windows Git Bash, я хочу, чтобы список файлов и проверка строки были равны, это плохо работает, я пытаюсь этот код:
- список файлов (/ run_file / test)
E:/Code/code.uio
models/test.php,php,js
public/test.php,html,php
rootPath=$(cd `dirname $0`; pwd)
aimPath=`head -1 ${rootPath}/run_file/$1`
cd ${aimPath}
while read -r line
do
if [[ "$line" != "$aimPath" ]]
then
# get file and checker
IFS=',' file=(${line})
for index in "${file[@]}"
do
# skipping this file name
if [[ ${index} = "${file[0]}" ]]; then
continue
fi
if [[ "${index}" = "php" ]]; then
echo "Index Matched"
else
echo "Index is NOT Matched ${index}.ABC"
fi;
if [[ "${index}" = php* ]]; then
echo "Index Matched and has other sign"
else
echo "Index is NOT Matched..."
fi;
done
fi
done < ${rootPath}/run_file/$1
Код подскажите .ABCIndex is NOT Matched php
и Index Matched and has other sign
Почему has other sign
?Я код ошибки?Я полностью озадачен.
PS:
Можно посмотреть Checker репозиторий - GitHub