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:
Code:
# @(#)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:
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
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:
Code:
#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:
Code:
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.
I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX.
The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (1 Reply)
Can anyone tell this:
If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used.
Thanks in advance for your help.
Iamnew2solaris (1 Reply)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (3 Replies)
Hello every body,
Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris??
To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time.
FYI I used... (5 Replies)
I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them)
Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Hi ,
'history' command shows the previous commands used. Is there any command to get the timings at which those commands were entered.
I am using Ksh.
Thanks. (2 Replies)