The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
history mirusnet Shell Programming and Scripting 1 01-27-2008 09:02 AM
History JuniorJack UNIX for Dummies Questions & Answers 2 06-02-2005 04:37 AM
Any History igorsch Linux 1 09-25-2004 12:45 PM
history tselvanin UNIX for Dummies Questions & Answers 2 09-23-2003 03:40 AM
history in ksh vince_ascend Shell Programming and Scripting 5 11-08-2001 04:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-23-2008
aladdin aladdin is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 78
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 (permalink)  
Old 01-24-2008
aladdin aladdin is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 78
is there any daemon I should run???
  #3 (permalink)  
Old 01-24-2008
drl's Avatar
drl drl is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 704
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 (permalink)  
Old 01-24-2008
aladdin aladdin is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 78
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 (permalink)  
Old 01-24-2008
drl's Avatar
drl drl is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 704
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 (permalink)  
Old 01-24-2008
aladdin aladdin is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 78
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0