0
如何測試從給定模式命名的文件(或多個)是否存在並根據該測試進行測試?測試bash中是否存在來自給定模式的文件
這是我的失敗嘗試:
[[ { ls ../outputListWorkerPid_* | wc -l } -ge "1" ]] && echo "ARRRRRR" || && echo "FAIL"
但我得到了以下錯誤:
bash: conditional binary operator expected
bash: syntax error near `ls'
而且這將是很好,以避免ls
的No such file or directory
在不存在的情況下。
這個答案對你有幫助嗎? http://stackoverflow.com/questions/6363441/check-if-a-file-exists-with-wildcard-in-shell-script – AlexLordThorsen 2013-04-09 17:01:50
是的,非常感謝! – RSFalcon7 2013-04-09 17:03:15