In my .bash_profile, executed for both my interactive and non-interactive logins are
BASH_ENV=$HOME/.myinteractivestuff
export BASH_ENV
doing this for bash on Linux works fine, but on Solaris is not sourced:
bash --version
GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10)
Curiously, if I invoke screen within my login shell, BASH_ENV is then read. Are any restrictions on when $BASH_ENV is respected on Solaris? In my case I'm logging in with ssh using putty, but also tried unix to unix ssh, and telnet and see the same.
Note that I know that my BASH_ENV variable assignment is being executed since I can echo this variable after login without any trouble (ie: ruling out the obvious possibility that my .bash_profile is also not being read).
It's not entirely clear what your expectations are. The bash manual says that the value of $BASH_ENV is only used when executing a shell script but your example suggests you are putting interactive commands in it
BASH_ENV=$HOME/.myinteractivestuff
.You are saying the BASH_ENV variable is set under Solaris, which means the two lines you posted are working correctly. The only thing they do is setting an exported variable and you confirm it's done.
If set, BASH_ENV is run when launching a bash shell script. That means if ~/.myinteractivestuff is run under your Linux environment, either you run some script elsewhere after BASH_ENV is set or you explicitly source it somewhere in your startup script.
By the way, you could have written the simpler:
export BASH_ENV=~/.myinteractivestuff