How do I test if a file (or many) named from given pattern exists and do stuff based on that test?
This is my failed attempt:
[[ { ls ../outputListWorkerPid_* | wc -l } -ge "1" ]] && echo "ARRRRRR" || && echo "FAIL"
But I got the following error:
bash: conditional binary operator expected
bash: syntax error near `ls'
Also it would be nice to avoid the No such file or directory
from ls
in case the doesn't exists.