View previous topic :: View next topic |
Author |
Message |
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Sun Jan 30, 2005 8:05 am Post subject: bash question |
|
|
I rarely use bash but I'd like to know how to disable the writing of $HOME/.bash_history for *all* users. I've added these lines to /etc/profile and even /etc/profile.env:
Code: | export HISTFILESIZE=0
unset HISTFILE
export HISTSIZE=100 |
I've invoked the shell as bash and as sh with no success. If I set the variables manually it works. So what global file does bash/sh parse? It doesn't appear to be /etc/profile. _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
nobspangle Veteran
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Sun Jan 30, 2005 8:10 am Post subject: |
|
|
you can put the variables in ~/.bash_profile however the system should source /etc/profile when you log in. |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Sun Jan 30, 2005 8:33 am Post subject: |
|
|
nobspangle wrote: | you can put the variables in ~/.bash_profile however the system should source /etc/profile when you log in. |
Yeah I know that. I wanted a global solution and not have to put a file in every user's home directory to disable a function that should be off by default. I edited /etc/profile to set a test variable and it doesn't get set. The permissions are 0644 and the owner is root. I have no clue why this file isn't getting parsed... _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
nobspangle Veteran
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Sun Jan 30, 2005 8:38 am Post subject: |
|
|
/etc/profile is definatley parsed on my system, I did
Code: | echo export\ DAVE=5 >> /etc/profile
su -
echo $DAVE |
and I get 5 as the result. The only thing I can think is that the variables you are trying to set are being set by another script after /etc/profile is parsed. |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Sun Jan 30, 2005 8:56 am Post subject: |
|
|
Figured it out. It has to be a login shell for /etc/profile to get parsed. I updated the cshrc file with an alias for sh to call bash -l and everything seems to be fine. I still think it's stupid to have a security hole like that on be default though. _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
thebigslide l33t
Joined: 23 Dec 2004 Posts: 792 Location: under a car or on top of a keyboard
|
Posted: Sun Jan 30, 2005 4:43 pm Post subject: |
|
|
also, putting 'source /etc/profile' near the top of .bashrc will work. |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Sun Jan 30, 2005 4:50 pm Post subject: |
|
|
thebigslide wrote: | also, putting 'source /etc/profile' near the top of .bashrc will work. |
I don't have a $HOME/.bashrc, a $HOME/.bash_profile or a $HOME/.profile. My point was I use bash very rarely (I use tcsh) and didn't want more files in the home directories just to turn this "feature" off. _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
|