Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

As I understand it, exporting an environment variable makes it available to any processes spawned from the current one. But the only processes that will be interested in the HISTIGNORE variable (and some related variables) are other instances of bash, which will read ~/.bashrc and pick up the value anyway. So should I use:

export HISTIGNORE="&"

or just:

HISTIGNORE="&"

in my .bashrc file?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

For shell settings, you don't need export, for the reason you give. And it's better not to use it, in case some other application reacts to the same variable but doesn't interpret the value in the same way. I don't know any other application that uses HISTIGNORE, but the issue arises with other variables. For example, PS1 should definitely not be exported since different shells use this variable but with different escape sequences.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.