How do you reference a positional parameter after $9?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

How do you reference a positional parameter after $9?

Explanation:
Referencing positional parameters beyond the ninth requires braces to clearly mark the parameter name. Once you reach two-digit indices, the shell needs ${10}, ${11}, and so on, rather than $10, to avoid ambiguity about where the parameter name ends. The brace form not only identifies the exact parameter, it also lets you safely attach extra characters or text, for example ${10}suffix or ${10}-more. This makes the expansion robust across shells and contexts. The other forms either don’t refer to the intended parameter correctly (arithmetic-like ${9+1} isn’t how you pull a positional parameter) or break when you try to append text, so they’re not reliable.

Referencing positional parameters beyond the ninth requires braces to clearly mark the parameter name. Once you reach two-digit indices, the shell needs ${10}, ${11}, and so on, rather than $10, to avoid ambiguity about where the parameter name ends. The brace form not only identifies the exact parameter, it also lets you safely attach extra characters or text, for example ${10}suffix or ${10}-more. This makes the expansion robust across shells and contexts. The other forms either don’t refer to the intended parameter correctly (arithmetic-like ${9+1} isn’t how you pull a positional parameter) or break when you try to append text, so they’re not reliable.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy