To execute the executable script test.sh in the current shell, the correct command is:
B. . test.sh
Explanation:
Option A) ./test.sh - This option is incorrect because it uses the dot slash notation to execute the script in a subshell, not the current shell.
Option B) . test.sh - This option is correct. The dot command, also known as the source command, is used to execute a script in the current shell. When you use the dot command followed by a space and the script name, it executes the script in the current shell environment.
Option C) sh test.sh - This option is incorrect because it runs the script using the sh command, which launches a new shell to execute the script.
Option D) exec test.sh - This option is incorrect because the exec command is used to replace the current shell process with the specified command. In this case, it would replace the shell with the execution of the test.sh script, which is not the desired behavior.
The correct answer is B. The command ". test.sh" is used to execute the executable script test.sh in the current shell.