I recently found that bash
test -e doesn't work with circular symlink.
ln -s ./test ./test if [[ -e ./test ]]; then echo "exists"; fi #this won't echo.
so I need to use
-e to do it
if [[ -L ./test || -e ./test ]]; then echo "exists"; fi
While this do fix my problem, I started to wonder if there's any other corner cases that
-e doesn't cover.
What other corner cases exists? Is there a portable and easy way to reliably detect a file exists?