syntax for env -u foo

Avi Greenbury lists at avi.co
Mon Mar 19 23:21:20 UTC 2012


Thufir Hawat wrote:


> Ah, I see.  I'm trying to remove rvm from the path, and I think this 
> command is what does that against the path variable?

Sort-of. $PATH is an environment variable, and env is a command that
allows you to modify the environment a program is run in. If you simply
want to remove the rvm related variables from your current environment,
you can do 

unset rvm_bin_path

and similar for each rvm related variable, and explicity reset your
$PATH to whatever you want:

export PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:\
/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

But this will not persist - the next time you create a session (by
opening a new shell or logging in again, for example) you'll get a
brand new bunch of environment variables set to the defaults.

If what you're after is instead to make sure that new sessions simply
don't have those variables set you need to find where the defaults are
set and modify them to suit. In general, you'll have added those rvm
lines to ~/.bashrc

-- 
Avi



More information about the ubuntu-users mailing list