Bash Scripting - Variables
You want to check if a script received exactly two arguments and print a message with the script name and arguments. Which snippet correctly uses special variables?
$# holds the number of arguments passed to the script.[ "$#" -eq 2 ] checks if exactly two arguments were passed.$# = argument count [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions