Bash Scripting - Error Handling
What will be the output of this script?
ls /nonexistent_dir echo $?
ls /nonexistent_dir echo $?
ls /nonexistent_dir tries to list a folder that does not exist, so it fails.$? holds a non-zero exit code, 2 for ls missing directories.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions