Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Debugging a broken tcsh history UNIX

When restoring my system from a backup, I mysteriously lost the ability to navigate or create any form of tcsh history. To my surprise, I couldn't find an answer on Mac OS X Hints. The solution for me was quite simple: make sure all the dotfiles initializing the shell (such as .tcshrc or ~/Library/init/tcsh/login.mine) exit cleanly, without any errors. I cleaned mine up, and my history returned.

[Author's note: This is a feeble hint, but perhaps it will help people as stumped as I was. There was no indication of this problem from the tcsh manpage or the database of past hints.]

  • Currently 2.00 / 5
  You rated: 2 / 5 (1 vote cast)

Debugging a broken tcsh history | 4 comments | Create New Account
Click here to return to the 'Debugging a broken tcsh history' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Authored by: serversurfer on Jun 21, '02 05:47:36AM
Wow! Thanks! I copied my login.mine to another box that didn't have Fink yet. I expected the error I was getting about not being able to read init.csh so of course I completely disregarded it when trying to figure out why I had no history!!

"Why wont it work?"
"Are there any errors?"

[ Reply to This | # ]
echo is your friend
Authored by: hayne on Jun 21, '02 02:32:42PM

I always (at least until I'm sure it's working) put a pair of 'echo' statements into my dot files
to bracket the places where I source some other file.
For example:
echo "About to source fink's init.csh file"
source /sw/bin/init.csh
echo "Back from init.csh"

That way, if there are errors in a file that I am sourcing, I can see that from the printouts.
When it is working, I just comment out the echo statements so they are there,
ready for reinstatement if I have any problems

[ Reply to This | # ]
echo is your friend
Authored by: serversurfer on Jun 21, '02 06:35:35PM

Oh, I got an error, but I was expecting it and it didn't concern me at the time, so I completely disregarded it as a possible source of my history problem. Basically, I didn't realize the login had to exit cleanly to establish the history.

Useful tip anyway, thanks. :)

[ Reply to This | # ]
echo is your friend
Authored by: kholburn on Jun 22, '02 07:01:14AM

I have at several places in my .tcshrc lines like this:

if (-e .debug) echo "running .tcshrc..."

When I need to debug I just do:

touch ~/.debug

and when I have finished debugging:

rm ~/.debug

[ Reply to This | # ]