1

I want to set the environment variables MAILPATH and MAIL permanently (i.e. make them persistent)

I already tried the following:

MAILPATH=/home/don/Maildir
export MAILPATH
MAIL=Maildir
export MAIL

This needs to be done every time I start a new bash shell (i.e., open new terminal etc.)

How do I make these settings permanent? I have tried setting these variables in /etc/environment but that does not make them persistent.

Byte Commander
  • 107,489
Don
  • 293
  • A side note, /etc/environment file is for system wide settings. You don't want to have same MAILPATH or such other settings pointing to your home directory made available to other users. https://help.ubuntu.com/community/EnvironmentVariables – user871199 Sep 15 '16 at 20:47
  • Please note that you can assign and export a shell environment variable in one single step: export MAILPATH=/home/don/Maildir – Byte Commander Sep 15 '16 at 20:52

1 Answers1

0

You can make it persistent by adding it to your ~/.bashrc file. This file is called every time you start an interactive bash shell.

Nick Sillito
  • 1,596