LX0-103 · Question #203
Which of the following commands is used to change options and positional parameters for a running Bash?
The correct answer is B. set. The 'set' builtin is the standard Bash command for modifying shell options and positional parameters in a running shell session.
Question
Which of the following commands is used to change options and positional parameters for a running Bash?
Options
- Ahistory
- Bset
- Cbashconf
- Dsetsh
- Eenvsetup
How the community answered
(21 responses)- B90% (19)
- C5% (1)
- E5% (1)
Why each option
The 'set' builtin is the standard Bash command for modifying shell options and positional parameters in a running shell session.
'history' displays or manipulates the command history list and has no ability to change shell options or positional parameters.
The 'set' builtin command is used in Bash to enable or disable shell options (e.g., 'set -e', 'set -x') and to assign positional parameters. It directly controls the behavior of the currently running Bash instance without requiring an external utility.
'bashconf' is not a real Bash builtin or standard Linux command.
'setsh' is not a real Bash builtin or standard Linux command.
'envsetup' is not a standard Bash builtin; it is sometimes a project-specific script in certain SDKs but has no role in changing Bash options.
Concept tested: Bash set builtin for shell options and parameters
Source: https://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin
Topics
Community Discussion
No community discussion yet for this question.