If you want to store the exit status of a command in a variable, you would typically use the _________ built-in variable.
- $?
- $!
- $#
- $@
If you want to store the exit status of a command in a variable, you would typically use the $? built-in variable. The $? variable contains the exit status of the last command executed, where 0 usually indicates success, and non-zero values indicate an error or failure.
Loading...
Related Quiz
- You're debugging a script and notice that an operation splits a string incorrectly. You suspect it might be related to the field separator. Which built-in variable should you check?
- While configuring a VPN on a Linux server, you're asked to ensure that the VPN supports both L2TP and IPsec. Which software solution would you likely consider?
- You've been tasked with writing a script that processes input arguments. How would you check if the number of arguments provided to the script is less than 3?
- In a shell script, the _________ command is used to parse options and arguments.
- When debugging, which shell built-in command can be used to read and execute commands from a file?