Bash Scripting - Variables
You wrote this script snippet:
But it always prints
echo "Last command status: $?" ls /nonexistent
But it always prints
Last command status: 0 even if the directory doesn't exist. What is the problem?