The simplest should be to rely on ls
return value (it returns non-zero when the files do not exist):
if ls /path/to/your/files* 1> /dev/null 2>&1; then
echo "files do exist"
else
echo "files do not exist"
fi
In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...
No comments:
Post a Comment