Check if file exists for hidden (.file) files
Ok, found it (by just trying really). Need to use -a
instead of -f
:if [ -a ".file" ]
-Edit-
Following the great advice by Cyrus, $ help test
will list all the test options. Specifically:
-a FILE True if file exists.
-f FILE True if file exists and is a regular file.