DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th August 2008
RandomSF RandomSF is offline
Port Guard
 
Join Date: May 2008
Location: Hartland, WI, USA
Posts: 13
Thanked 0 Times in 0 Posts
Default History not saved in tcsh

I use tcsh as my login shell and in X and have these lines in .cshrc
Code:
set history=200
set savehist=200
set histdup=erase
My history file, however, never changes. While I am working, the history list grows, but the next day when I boot up only the first 20 items are there. The next day is the same thing, with the same twenty items.

Is there some problem with having the shell in X and the login shell both being tcsh? I wouldn't have thought so, but am puzzled as to why the history file doesn't change.
Reply With Quote
  #2   (View Single Post)  
Old 18th August 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Are you saying that after the first day, the same exact 20 items are locked into your history day after day without changing?
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
  #3   (View Single Post)  
Old 18th August 2008
RandomSF RandomSF is offline
Port Guard
 
Join Date: May 2008
Location: Hartland, WI, USA
Posts: 13
Thanked 0 Times in 0 Posts
Default

Yes, it's the same set of 20.
Reply With Quote
  #4   (View Single Post)  
Old 18th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,074
Thanked 198 Times in 156 Posts
Default

Try:
set savehist=200 merge
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #5   (View Single Post)  
Old 18th August 2008
RandomSF RandomSF is offline
Port Guard
 
Join Date: May 2008
Location: Hartland, WI, USA
Posts: 13
Thanked 0 Times in 0 Posts
Default

Carpetsmoker, do you mean
Code:
savehist=100 merge
as described in this section of the man page,
Code:
If the second word of savehist is set to `merge', the history list is merged  with the  existing history file instead of replacing it (if there is one) and sorted by time stamp.  (+) Merging is intended for  an environment like the X Window System with several shells in simultaneous use.  Currently it succeeds only when theshells quit nicely one after another.
as per you sig?

Sigh, I get so sore kicking myself for not finding those things by myself.

Thanks. It works.
Reply With Quote
  #6   (View Single Post)  
Old 19th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,074
Thanked 198 Times in 156 Posts
Default

Quote:
Carpetsmoker, do you mean
savehist=100 merge
Well, you're setting a variable, so you should use ``set'' ... Maybe the set keyword can be omitted for special shell variables? I don't know ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #7   (View Single Post)  
Old 19th August 2008
RandomSF RandomSF is offline
Port Guard
 
Join Date: May 2008
Location: Hartland, WI, USA
Posts: 13
Thanked 0 Times in 0 Posts
Default

Yes, yes a variable that I 'set'. I had that part. I just didn't think the 'merge' part applied, when the fact is that is precisely what does apply in this situation. Like I said, it's working as expected now.

Thanks again.
Reply With Quote
  #8   (View Single Post)  
Old 9th December 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Is it possible in CSH (not TCSH) to enable it to scroll through history with the up and down arrow keys?
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
  #9   (View Single Post)  
Old 9th December 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

The csh has history, but the 'classic' style is probably not what you expect.

http://tomecat.com/jeffy/tttt/cshhistory.html


You essentially manipulate a history list from the prompt.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
working with .profile and history uptonm OpenBSD Security 1 15th August 2008 12:14 PM
TCSH: 'set promptchars' not effecting su like it should JMJ_coder General software and network 4 9th July 2008 09:51 PM
TCSH - getting to start of line maxrussell FreeBSD General 3 4th July 2008 11:55 AM
weird history problem mmusang FreeBSD General 2 17th May 2008 07:07 PM
Quick, simple tcsh tips for beginners anomie Guides 6 5th May 2008 08:07 PM


All times are GMT. The time now is 05:15 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick