Multiple choice technology operating systems

The command is used within a function to exit the function with a given status.

  1. local

  2. function

  3. return

  4. parameter

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

The return command exits a function and returns an optional exit status. 'local' creates local variables, 'function' declares functions, and 'parameter' is not a shell keyword. return is the only command that exits a function with a status code.

AI explanation

In shell scripting, return is used inside a function to exit that function and optionally set its exit status, similar to how exit works for a whole script. local just scopes a variable to the function, and function is merely the keyword used to declare one, so neither of those causes an exit.