Questions
- Which two of the following methods would you use to create a function? (Choose two.)
function function_name()
function_name()
declare -f function_name
declare -F function_name
- You want to create a function that will pass the value of a variable back to the main program. Which of the following should you use to do that?
- A global variable
- A local variable
- A
return
statement - A continue statement
- You want to create a function that any user can use in his or her own scripts. What is the best way to do that?
- Create a function library file in a central location, and make it executable.
- Add the new functions to the
/etc/bashrc
file. - Create a function library file in a central location, but don’t make it executable.
- D. Create a function library file in your own home directory.
- Which...