![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sourcing the .bashrc | Nusy | UNIX for Dummies Questions & Answers | 3 | 05-27-2008 02:23 PM |
| .bashrc question re: rm -i & ls --colors | kthatch | UNIX for Dummies Questions & Answers | 16 | 04-21-2008 02:06 PM |
| alias rm = 'rm -i' in .bashrc and vnc | cy163 | UNIX for Dummies Questions & Answers | 0 | 05-23-2007 06:57 AM |
| Need to run source .bashrc everytime | kalyanraj | Shell Programming and Scripting | 2 | 09-22-2006 06:06 AM |
| from bashrc to sh..?? | moxxx68 | Shell Programming and Scripting | 3 | 09-13-2004 02:39 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
history -c in my .bashrc
Hi, I come into unix with csh, but i switch to bash . I want to clear my command history for each session, history -c, but for some reason this doesn't work in the .bashrc file. I know that the file is running after I type bash on my csh command line because I get the hello back. If I am already in bash and type source .bashrc, then it will work perfectly. What's going on?
#.bash set -o vi PS1="\H"\.ba."\!"\> history -c source .aliases echo HELLO |
| Forum Sponsor | ||
|
|
|
|||
|
My Understanding
As I understand it, history -c clears the history from the shell environment. It does not clear the .bash_history file. It probably clears the environment variable and then re-reads the .bash_history file as the last step.
Use history -w to overwrite the .bash_history file with the current environment. You can also use history -cw to clear the shell history and then overwrite the .bash_history file. ; |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|