How would I add a value to a new variable in bash, so that when I echo the variable Emacs would run?
You can't make bash to invoke commands during
echo as far as I know. If I understand well your question you are searching for
alias editor='emacs' editor # will invoke emacs
You can store the alias in your
.bashrc or just edit on-the-fly as you wish.
Is this what you were looking for?
editor=emacs $editor # This will invoke emacs.