Multiple choice technology operating systems

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

The correct bash function syntax is function_name() { commands; }. Option B has a space before () which is invalid. Option C has incorrect syntax with parentheses around function name and missing braces. Option D is incorrect as option A is valid.