in comp.unix.admin i read:
>hi, in ksh, .sh_history keeps a record of commands typed by user. how
>about csh? thanks
don't you ever read any documentation?
man csh
--
bringing you boring signatures for 17 years
yes, i read already before posting here.
these are some of the files that i have noticed
1) .login
2) .logout
3) .cshrc
4) /usr/bin/sh
5) /etc/passwd
in man csh. But nowhere , did i noticed something close to .sh_history in ksh
please advise
in comp.unix.shell i read:
>in man csh. But nowhere , did i noticed something close to .sh_history in ksh
then you were skimming, and poorly. try again:
man csh
/histfile
i did a search for histfile but it was not found.
in comp.unix.shell i read:
>those who know me have no need of my name <not-a-rea...@usa.net>
>wrote in message news:<m1n0m5y...@usa.net>...
>> man csh
>> /histfile
>
>i did a search for histfile but it was not found.
okay, okay, so your documentation is poor:
[from man csh, tcsh is substantially similar]
histchars Can be given a string value to change the characters used
in history substitution. The first character of its value
is used as the history substitution character, replacing
the default character `!'. The second character of its
value replaces the character `^' in quick substitutions.
histfile Can be set to the pathname where history is going to be
saved/restored.
history Can be given a numeric value to control the size of the
history list. Any command that has been referenced in this
many events will not be discarded. Too large values of
history may run the shell out of memory. The last executed
command is always saved on the history list.
i did this in my csh
set histfile=/.temp
then, i issued, more .temp
and checked by a more .temp, it is empty.
what is wrong?
Either you are in "/" or you need "more /.temp"
But have you permission to write in "/"?
Better
set histfile=./temp
perhaps... :-)
I'd prefer
set histfile=./history
It's the standard name and you know that it's the history. ;-)
Umberto
Did you find a copy of the real man page to read? The problem is csh behaves
as described in the csh man page not as described in the ksh/bash man pages.
The history mechanism in csh and ksh/bash are very different, and deliberately
so. Any book on shells covers this topic. Different behavior is one of the
reasons that different utilities exist. What basic reading have you done?
It's time for more of it.
With ksh/bash, the .sh_history file is maintained as each command is executed.
If you are logged in in several windows the commands are interleaved realtime.
This can be good or bad depending on your tastes. With csh, the history is
only maintained in memory and the $histfile variable is for the file to use to
dump that memory when the shell exits. If you are logged in in several windows,
the one that exits last wins. Again this can be good or bad depending on your
tastes. So, to see what will appear in /.temp, logout and log back in again.
This is ksh behavior, not bash behavior; bash maintains the history in
memory (like csh), and appends to the history file when it exits.
> This can be good or bad depending on your tastes.
The interleaving of commands in ksh history used to drive me nuts. It
makes it all too easy to repeat a command (with "r") from some other
running shell, with possibly unintended consequences if that command
is, say, "rm *". My solution was to give each shell its own history
file, with the hostname and tty number embedded in the name.
--
John Wingate Mathematics is the art which teaches
joh...@worldpath.net one how not to make calculations.
--Oscar Chisini
i have "set histfile=$HOME/.history" in my .cshrc
then i do a "set" and saw the below
histfile /home/sa1adm/.history
but my history commands are not logged.
i have "man csh" but didnt have this histfile as a shell variable.
please advise..
i am on aix 4.3
Indications of need of upgrade ... to ... [a|ba|k|z]sh,
perhaps? You're not actually writing 'csh' modules, as well,
... or are you?
TMH
Tim
Logout. Login. Inspect file. If that does not work, you have a broken csh.
Fixed by downloading sources and building on your system, or by switching to
a better shell. In your case, I vote for doing *both*. You're progressing
along just fine and you will benefit from using other shells and also from
betaing on source code to get it to compile.
> i have "man csh" but didnt have this histfile as a shell variable.
This is a hint that you have a broken csh. Running AIX is also a hint that
you have a broken csh. AIX randomly changes standard Unix utilities for no
good reason. The tradeoff is AIX has several features that other versions
of Unix do not. Is running AIX woth the price of breaking standard Unix
utilities? That depends on whether you really do only use the AIX-only
functionality.
I though csh has already been considered broken - globally.
> Fixed by downloading sources and building on your system,
I'm sure the system administrators would buy this. OTOH, It may be
an opportunity to put some too-little-too-late fixes into 'csh', No?
> or by switching to a better shell.
You really meant ANY shell didn't you?
I vote for tcsh!
> In your case, I vote for doing *both*.
Sequentially or in parallel?
> You're progressing along just fine and you will benefit from using
> other shells and also from betaing on source code to get it to compile.
Oh, boy! An expedition! Let's go!
>
>> i have "man csh" but didnt have this histfile as a shell variable.
>
> This is a hint that you have a broken csh.
Sounds to me like it's a hint that /usr/man stuff is in trouble.
I vote for getting his hands on a paper copy.
> Running AIX is also a hint that you have a broken csh.
And that someone also has a big IT budget! Big enough to waste
resources on 'expeditions', I wonder?
> AIX randomly changes standard Unix utilities for no good reason.
Now I know why I'm not running on AIX! These 'changes' must
be automated random updates, No.
> The tradeoff is AIX has several features that other versions
> of Unix do not. Is running AIX woth the price of breaking standard Unix
> utilities?
Does AIX check-in the source code for these random changes?
Are you affiliated with HP by any chance?
> That depends on whether you really do only use the AIX-only
> functionality.
Maybe you should have let the OP answer this one.
HTF
Tim
The same broken shell with some good interactive features. ;)
--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
where can i fixed the broken csh?
1) 'Fixed' it everywhere ... that's where!
2) Ask: bil...@sun.com. Tell him you want the REAL source
code for csh this time and NO FUNNY BUSINESS!
3) Call IBM Tech Support and ask for a 'random' csh update.
4) su -; rm -f /bin/csh; ln /bin/tcsh /bin/csh. *
5) Slide to UC Berkley circa 197? and get Bill Joy a life.
6) Replace the entire AIX system with SUN or HP to get a new one.
7) 'Fixed' it in /bin/csh byte: 7E4A.
8) Take it to an Aquarium - they might have some super-glue.
9) Line 158 of /usr/src/csh/main.c - add an 'exit(1);'.
10) Log out. Find nearest bar. Get plowed. Log back in. Inspect file
(if you can find it). If you can't find it, go to item 3).
* WARNING: Don't try this at system.
Any Questions?
HTH
Tim
How not where. Did you miss the part of my posting that said "Fixed by ..."?
Download the csh sources from someplace that has one that works, and build it
for your system.
Doh! :-)