csh History


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers csh History
# 1  
Old 01-23-2008
csh History

Hello everybody,

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:

Code:
set histfile=/.history

set history=200




Thanks in advance
Aladdin
# 2  
Old 01-24-2008
is there any daemon I should run???
# 3  
Old 01-24-2008
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
# 4  
Old 01-24-2008
Thanks for your reply 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.

Regards
Aladdin
# 5  
Old 01-24-2008
Hi.

Here is how I quickly check to see what shell I am using:
Code:
vm-solaris% ps | grep $$
   666 pts/2       0:00 csh

If you were actually using bash, it would look like this:
Code:
vm-solaris drl ~ $ ps | grep $$
   585 pts/2       0:00 bash

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:
Code:
set savehist=10

in .cshrc ... cheers, drl
# 6  
Old 01-24-2008
Hi drl,
and thanks again for your help.

the output for "ps" was csh:

Code:
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.

Many Thanks
Aladdin
# 7  
Old 01-24-2008
Hi.

Please enter the following commands, and post the output:
Code:
set history=5
echo one
history

The "savehist" command is for saving the history across logins ... cheers, drl

(We should talk about "... .cshrc: No such file ...", but we can do that later.)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

The Great History of UNIX (1969-1999) | 30 Years of UNIX History | YouTube Video

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)
Discussion started by: Neo
8 Replies

2. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

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)
Discussion started by: sriky86
1 Replies

3. UNIX for Dummies Questions & Answers

The history command: See other users command history

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)
Discussion started by: iamnew2solaris
1 Replies

4. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

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)
Discussion started by: linuxadmin
3 Replies

5. UNIX for Dummies Questions & Answers

How to review the history and the commands that has been done in this history?

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)
Discussion started by: ahmedamer12
5 Replies

6. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

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)
Discussion started by: pollsizer
1 Replies

7. Shell Programming and Scripting

History ??

Hi, How can i see first 3 commands that are there in history {fc -l} ? Thanks (1 Reply)
Discussion started by: varungupta
1 Replies

8. UNIX for Dummies Questions & Answers

history

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)
Discussion started by: tselvanin
2 Replies
Login or Register to Ask a Question