Multiple choice technology programming languages

If the argument list is omitted from a for command, where does it take its values from?

  1. The $* shell variable
  2. The $@ shell variable
  3. Redirected input

  4. Redirected output

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When the argument list is omitted from a for loop, it defaults to iterating over the positional parameters passed to the script or function. The $@ variable represents all positional parameters as separate words, making it the default source for iteration when no explicit list is provided.