Im being unsuccessful to enable command history logging in csh shells on a Sun machine running Solaris 9, I know csh doesnt log commands history by itself,
here under is my /.cshrc file:
# @(#)cshrc.standard 1.1 Copyright 1994, Motorola Inc.
if ( -e /.datagen_system ) then
source /usr/gsm/DataGen/current/config/local/cshrc.datagen
if ( -f $HOME/.dg_profile ) then
source $HOME/.dg_profile
endif
else
source /usr/omc/current/env/.cshrc
endif
alias omc_env 'source /usr/omc/config/global/pmInfxUserConfig.csh'
alias mib_env 'source /usr/omc/config/global/mibInfxUserConfig.csh'
alias omclog tail -f /usr/omc/logs/omcaudit`date +%Y%m%d`
alias usrlog tail -f /usr/omc/logs/usrauditlogs/usraudit`date +%Y%m%d`
alias h history
alias glu /usr/omc/ne_data/GLU
set filec
set histfile=/.history
set history=200
I also dded the following lines to my /etc/profile:
The /etc/profile is for Bourne-family shells, sh, bash, etc. If you placed those set commands in that file, you would effectively set the first argument to "history=200".
The shells are conceptually simple, they read in lines of text, usually interpret the first token as a command, run it, and wait for the next command to run. I am not aware of any connection to a daemon that would be necessary for the shells to run.
I have a very simple .cshrc file on Solaris 10:
#ident "@(#)local.cshrc 1.2 00/05/01 SMI"
umask 022
set path=(/bin /usr/bin /usr/ucb /etc .)
if ( $?prompt ) then
set history=32
endif
and the history mechanism works for me.
First things first: how do you know that you are running csh? ... cheers, drl
I tried also commenting the two lines in /etc/profile but still same result.
as for knowing the shell, emmm. actually Im using "ps" command, and "echo $$", is that right???
but it is still not running, I will post any solution might work.
We need to refine the question a bit. Are you getting any output what you enter:
history
or are you concerned about the lack of a command history across a login -- that is, when you login again, there is no history? If that is true then you probably need something like:
cl1# ps | grep $$
7344 pts/1 0:00 csh
cl1# history
cl1# set savehist=10
cl1# history
cl1# ./.cshrc
/usr/omc/current/env/.cshrc: No such file or directory
cl1# history
cl1#
as you can see the history command returned nothing, even though I set the savehist var, and added it to .cshrc and reinitialize the file.
As to what was wrong -- I don't know. Perhaps the correct commands were not present at the right time and place.
The important thing is that you see that there is cause and effect for the appropriate commands to set up the history mechanism for the login name (account, user, etc.) that you are currently using.