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
if [ -e file.txt ]; then
You need spaces. [ and ] are regular programs.