Multiple choice technology operating systems

while getopts a:bc arg ; docase $arg ina ) echo "$OPTIND" ;;b ) echo "$OPTIND" ;;c ) echo "$OPTIND";;esacdoneWhat does the colon(':') after 'a' in the first line signify ?"

  1. The getopts command ensures that a parameter is passed for -b option

  2. It signifies that u have to either specify -a option or you have to specify both -b and -c options

  3. The ":" has no effect in the command

  4. The getopts command ensures that a parameter is passed for -a option

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

In the shell built-in getopts command, placing a colon (:) immediately after an option letter indicates that this specific option requires an argument. Thus, a: ensures that a parameter must be passed whenever the -a option is used.