我有一个带有ipa文件的文件夹。我需要通过在文件名中使用appstore
或enterprise
来识别它们。正则表达式与文件路径中的名称不匹配
mles:drive-ios-swift mles$ ls build
com.project.drive-appstore.ipa
com.project.test.swift.dev-enterprise.ipa
com.project.drive_v2.6.0._20170728_1156.ipa
我已经试过:
#!/bin/bash -veE
fileNameRegex="**appstore**"
for appFile in build-test/*{.ipa,.apk}; do
if [[ $appFile =~ $fileNameRegex ]]; then
echo "$appFile Matches"
else
echo "$appFile Does not match"
fi
done
但是没有匹配项:
mles:drive-ios-swift mles$ ./test.sh
build-test/com.project.drive-appstore.ipa Does not match
build-test/com.project.drive_v2.6.0._20170728_1156.ipa Does not match
build-test/com.project.test.swift.dev-enterprise.ipa Does not match
build-test/*.apk Does not match
如何将正确的脚本修改成相匹配build-test/com.project.drive-appstore.ipa
?
尝试' fileNameRegex = “* AppStore的。*”'。 – Phylogenesis