Fixes the profiles-plugin

An error was introduced with 7f75bb9, which uses special vars. This is the
fix.
Merge pull request #3299 from apoxa/fix-profiles

Fix for the profile plugin.
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.