views:

406

answers:

2

I use Cygwin's bash shell (bash -i) daily for common tasks.

In my .bashrc file, I have the following:

history -rc bashcommands.history
history

Above the first prompt line, I see the list of history commands from bashcommands.history, so it looks like the history has been changed.

However, if I now enter "history" at the prompt, it shows my original history, not what's in bashcommands.history.

If I enter "history -rc bashcommands.history" at the prompt, the history file loads as expected, and then "history" will show the commands.

Is there some environment or shell settings being reset after .bashrc is processed? I don't see anything in the man pages that would explain it.

How can I get the history file loaded before the first prompt?

A: 

Have you tried putting it in your .bash_profile?

RobS
.bash_profile and .profile both do nothing. I placed some echo statements in those files, and they don't show any echoing on the screen. only .bashrc is processed.
ericp
A: 

For those who are interested, this worked:

  1. I set my ENV environment variable to ~/.bashrc
  2. I ran the command bash --posix
ericp