The correct configuration file to modify in order to globally set shell variables for all users is /etc/profile. This file is executed for login shells and applies settings that should be available to all users on the system. Therefore, modifying /etc/profile ensures that the shell variables are globally set for everyone.
The 'export' command is used to set environment variables that are passed to child processes. The 'set' command is used to set and unset shell options and positional parameters. These commands are essential for managing environment and shell variables within a shell process.
In Bash, the correct syntax for defining a function is to use the 'function' keyword followed by the function name and curly braces to enclose the commands of the function. To output the sum of two numbers, we can use the 'echo' command and arithmetic expansion with $(($1 + $2)). This allows us to pass two arguments to the function, add them together, and print the result. The other options use incorrect keywords or do not perform the arithmetic operation correctly.