7

I have an open terminal in ubuntu lucid in which I need a new env variable set.So,I open the .bashrc file and edit it ,to add the new env variable( say PYTHONPATH)

.bashrc

PYTHONPATH=/some/path
export PYTHONPATH

But,in order to get this effective ,I need to close my terminal and open it again.Is there some command with which I can get this effect,without close/open the terminal again.

damon
  • 7,637
  • 17
  • 66
  • 108

2 Answers2

17

Take a look at the source command: man source

source ~/.bashrc

Apart from that: why don't you simply use the environment commands directly in your shell to set an additional environment variable?

export PYTHONPATH="/some/path"

That way the created variable is effective right away.

arkascha
  • 39,439
  • 7
  • 52
  • 86
  • thanks @arkascha ,learned something good today.. you are right .it can be done in both ways – damon May 31 '13 at 06:25
1

You can also try,

sat:~# . ~/.bashrc 
sat
  • 14,061
  • 6
  • 43
  • 63