The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sourcing the .bashrc Nusy UNIX for Dummies Questions & Answers 3 05-27-2008 05:23 PM
.bashrc question re: rm -i & ls --colors kthatch UNIX for Dummies Questions & Answers 16 04-21-2008 05:06 PM
alias rm = 'rm -i' in .bashrc and vnc cy163 UNIX for Dummies Questions & Answers 0 05-23-2007 09:57 AM
Need to run source .bashrc everytime kalyanraj Shell Programming and Scripting 2 09-22-2006 09:06 AM
from bashrc to sh..?? moxxx68 Shell Programming and Scripting 3 09-13-2004 05:39 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-23-2005
yankee428 yankee428 is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 27
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
  #2 (permalink)  
Old 06-23-2005
SemiOfCol SemiOfCol is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 18
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.

;
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0