Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I realise my question had omitted a wish / requirement, sorry for the missing detail. Namely: I'd prefer not to have to remember to use aliases / functions; i.e. the scoping should work as an add-on to the way I normally interact with the shell. Commented Jun 2, 2015 at 15:15
  • Don't export HISTFILE. There's no reason to export it to other programs, and ~/.bashrc is executed for every interactive bash process, so your code for setting it is going to be run in every bash anyway. In general, if a shell-defined variable isn't exported by default, you rarely should export it. Commented Jun 16, 2015 at 5:26