tcsh history and source question (for perlbrew)

Hello all!



First: I am on 10.7.5 and still working on tcsh. I got used to it; so I did not switch to bash ...


When I start the Terminal (shell) I see the previous commands grayed out. How to hinder this?


Doing the following commands:


% echo $history

100

% echo $histfile

histfile: Undefined variable.

and

% history

...

I get the last commands from the actual session. So there must be somewhere a history file, which I am unable to find:


In my home folder are :


.bash_history (I am on tcsh)

.lesshst

.profile

.tcshrc


which have nothing to do, with the tcsh history. And there is no ~/.history or ~/.login ... I looked also into /etc the files


csh.cshrc

csh.login

csh.logout


But no help! I would be gratefull for every hint. My question is:

1. where is my tcsh history file?

2. How to hinder the grayed out history in my tcsh window at start up?


***


Now an other question:


I am only able to start and switch my Perl installation over perlbrew in bash, because in the ~/.bashrc is a source command like follows:


source ~/perl5/perlbrew/etc/bashrc


which points to a long bashscript to enable the start of different Perl versions installed under ~/perl5


putting this line into my ~/.tcshrc source ~/perl5/perlbrew/etc/bashrc throws up the error:

export: Command not found.

Badly placed ()'s.

Probably because the bash script (~/perl5/perlbrew/etc/bashrc) is not excuted in tcsh?


Thank you for your help



marek

MBP 17

Posted on Feb 3, 2013 5:35 AM

Reply
3 replies

Feb 3, 2013 11:53 AM in response to Marek Stepanek

1. where is my tcsh history file?

You need to configure tcsh to save history. Something like this in .tcshrc or .login


set histdup=erase
set history=500
set savehist=500

The file .history will be created by the shell.


2. How to hinder the grayed out history in my tcsh window at start up?

I'm guessing that sourcing perlbrew's bashrc is screwing up tcsh when it attempts to read it. The path of least resistance would be to change your shell to bash so you can use perlbrew. If you want to keep tcsh as your interactive shell then source perlbrew's bashrc in the .bashrc in your home directory. Create a bash sub-shell by typing bash in your tcsh shell.

Feb 3, 2013 12:07 PM in response to Marek Stepanek

I've noticed this 'ghost history' thing in terminal under bash, as well. It started with 10.8, and I'd been working under the assumption that it's Terminal's equivalent of document revisioning. If it helps any, in Terminal Preferences -> Shell you can run a clear command at startup: click the checkboxes that say 'Run command' and 'Run inside shell' and type 'clear' into the text box.

User uploaded file

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

tcsh history and source question (for perlbrew)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.