Automation, Orchestration, and Scripting

Which three statements about managing variables and aliases in Bash are correct? (Choose three.)

Choose 3 answers

Show the answer

Correct answersA. unset removes a shell variable so it no longer expands to a valueB. unalias ll removes the alias named ll from the current shell sessionC. local limits a variable's scope to the function in which it is declared

AWhy this is right: unset deletes the variable, so it expands to an empty string afterward.

BWhy this is right: unalias removes the named alias from the current shell session.

CWhy this is right: local makes a variable exist only for the function that declares it and the functions it calls.

DWhy not this: export passes a variable down to child processes; nothing a script does reaches its parent shell.

EWhy not this: A script runs in a child shell, so aliases it defines disappear when it exits.

FWhy not this: unset -v removes PATH entirely; nothing reloads /etc/profile, so commands then fail to be found.

unset deletes a variable, unalias removes an alias from the current session, and local confines a variable to its function. export passes a variable down to child processes only, never up to the parent shell, so that statement is wrong. A script runs in a child shell, so its aliases vanish when it ends, and unset -v PATH removes PATH rather than restoring a default.