我有一個帶有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