Question 290
The script below is run as `./task.sh 21 32 4` on a RHEL 10 host: #!/bin/bash printf "%s" "${2}-${3}-${1}" What exact text is printed to standard output?
Explanation
Correct Answer
The braces select arguments in the explicit order $2=32, $3=4, $1=21.
Incorrect Answers
The printed text would not be 21-32-4; the script uses exactly the stated parameter positions and Bash expansion, so the computed result is 32-4-21.
The printed text would not be 32-21-4; the script uses exactly the stated parameter positions and Bash expansion, so the computed result is 32-4-21.
The printed text would not be 4-32-21; the script uses exactly the stated parameter positions and Bash expansion, so the computed result is 32-4-21.






Red Hat Certified System Administrator (RHCSA) (EX200) Practice Tests