minishell
minishell copied to clipboard
[BUG] `_` environment variable should not get created nor printed by export
export should ignore the _ (single underscore) env variable that can get inherited from the previous shell.
- [ ] Just
exportshould not print an entry for_. - [ ] Trying to create a variable like this
_=abcshould do nothing.
In bash, this variable always gets updated with the last argument to the previous simple command, after expansion. And for the executed commands, this variable gets prepared with the full pathname of the command to be executed. https://www.gnu.org/savannah-checkouts/gnu/bash/manual/html_node/Bash-Variables.html
To see the behavior, test with declare | grep _=.