LOCAL_VAR="Only here"
exportexport GLOBAL_VAR="Everywhere"
$? - Exit status of last command (0 = success)$$ - Process ID of current shell$! - Process ID of last background commandecho "Last command status: $?"
echo "Shell process ID: $$"
# String length
VAR="Hello World"
echo ${#VAR} # Output: 11
# Substring
echo ${VAR:0:5} # Output: Hello
echo ${VAR:6} # Output: World
# Default values
echo ${VAR:-"default"} # Use VAR or "default" if empty
echo ${VAR:="default"} # Set VAR to "default" if empty
Next: → Troubleshooting Common Issues
Previous: ← Practical Lab Environment Setup
Lesson Home: ↑ Lesson 3: History & Variables
Course Home: ⌂ Introduction to Linux