Multiple choice technology operating systems

How do you find out the number of arguments passed to the shell script?

  1. $*
  2. $@
  3. $#
  4. $?
Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

$# is a special shell variable that expands to the number of positional parameters passed to the script or function. $* and $@ both expand to all parameters (quoted vs unquoted behavior differs), while $? contains the exit status of the last command.