This is from a comment at Understand the meaning of `$_`When I open a new tab in gnome terminal, I run immediately$ echo $_EDITORIs the output because the last line in ~/.bashrc   isexport EDITOR=emacs -nwWhy does echo $_ output EDITOR, instead of other words in the line or the whole line?Which rule in the following quote from the bash manual does this case belong to_                          At shell startup, set to the absolute pathname used to  invoke the shell or shell script being executed as passed in the environment  or argument list. Subsequently, expands to the last argument to the previous  command, after expansion. Also set to the full pathname used to invoke each command executed and placed in the environment exported to that command.  When checking mail, this parameter holds the name of the mail file.
What does `echo $_` output after `export foo=bar`?
bash