QuestionQ68

VerifiedEssential Commands

After defining the following in Bash:

function myfunction \{ echo $1 $2 ; \}  

what output does this command produce?

myfunction A B C  
Explanation

Bash assigns a function’s arguments to positional parameters in order. $1 is A and $2 is B, so echo $1 $2 outputs A B.

Community Discussion

No comments yet. Be the first to start the discussion!