I\'m trying to check if a file exists using bash. This is my code
if [-e file.txt]; then echo \"file exists\" else echo \"file doesn\'t exist\" fi
Woops, turns out I needed a space between [ and -e. Like this:
[
-e
if [ -e file.txt ]; then echo "file exists" else echo "file doesn't exist" fi