Multiple choice technology architecture

What does the below Command Line Argument Does? $#

  1. Process number of current process.

  2. Process number of background process.

  3. All arguments on command line.

  4. Number of positional parameters.

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

The $# variable in shell scripting represents the number of positional parameters passed to a script. Option A describes $$ (current process ID), Option B is incorrect as there's no standard variable for background process count, and Option C describes $* or $@ (all arguments). $# counts how many arguments were provided.