Multiple choice technology programming languages

Which of the following are syntax that can be used to declare a function?

  1. function_name() {command-list }

  2. function_name ( ) { }

  3. function name (command list ) {

  4. None

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

Shell functions are declared using the function_name() { command-list; } syntax. The function name is followed by empty parentheses, then a command list enclosed in braces. This is the standard POSIX-compliant function declaration format in bash and other Unix shells.