Change all whoami calls for $USER variable

This avoid spawning additional processes, as the $USER variable will
**always** contain the current logged-in user.
Change all pwd calls for $PWD variable

This avoids spawning additional processes as $PWD **always** contains
the current working directory.
Change all hostname calls for $HOST or $SHORT_HOST
Merge pull request #3223 from mcornella/use-special-vars

Use special variables where we can
Respect original PATH definitions on install

The exporting of PATH as a fixed string would clobber any system-wide
paths added to env after installation. Instead, we now read any existing
PATH exports from previous config files and copy those from the user's
bash config, or else default to a basic prepend-only example that
respects the system environment.
Use sed instead

This needs the extra newline character defined in a variable because
shells treat the ${} expansion differently for replacing newline characters.