Bash Scripting - Conditionals
Identify the error in this bash snippet that checks if a file exists and is executable:
if [ -e myscript.sh -a -x ]; then echo "Executable file"; fi
if [ -e myscript.sh -a -x ]; then echo "Executable file"; fi
-x operator requires a filename argument, but none is provided after it.-e myscript.sh is valid to check existence; spaces around -a are correct; using single brackets is valid.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions