; } in Bash, which output does: myfunctio… | Linux Foundation Certified System Administrator (LFCS) Q112 | CertBase

Linux Foundation Certified System Administrator (LFCS) — Question 112

After issuing:
function myfunction { echo $1 $2 ; }
in Bash, which output does:
myfunction A B C
Produce?

Answer options

Correct answer: A

Explanation

The correct output is A B because the function myfunction is defined to echo only the first two arguments passed to it, which are A and B. The third argument, C, is ignored because the function does not reference it.