Multiple choice technology programming languages

The shell metacharacter $# represents ?

  1. No of arguments supplied to the shell script

  2. Total no of files in the current directory

  3. Total no of users who have logged in

  4. Total no of processes running in background

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

In shell scripting, $# is a special variable that holds the count of positional parameters passed to the script. When a shell script is executed with arguments like './script.sh arg1 arg2 arg3', $# will contain the value 3, representing the total number of arguments supplied. This is useful for validating argument counts before processing.