Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.sh_history for ksh, how about csh

115 views
Skip to first unread message

yls177

unread,
Jan 11, 2003, 11:32:56 AM1/11/03
to
hi, in ksh, .sh_history keeps a record of commands typed by user. how
about csh? thanks

those who know me have no need of my name

unread,
Jan 12, 2003, 3:31:41 AM1/12/03
to
[fu-t set]

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

yls177

unread,
Jan 12, 2003, 6:34:03 PM1/12/03
to
those who know me have no need of my name <not-a-rea...@usa.net> wrote in message news:<m1smvyd...@usa.net>...

> [fu-t set]
>
> 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

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

those who know me have no need of my name

unread,
Jan 12, 2003, 7:51:13 PM1/12/03
to
[fu-t set]

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

yls177

unread,
Jan 14, 2003, 12:06:33 AM1/14/03
to
those who know me have no need of my name <not-a-rea...@usa.net> wrote in message news:<m1n0m5y...@usa.net>...

> [fu-t set]
>
> 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.

those who know me have no need of my name

unread,
Jan 14, 2003, 2:13:15 AM1/14/03
to
[fu-t set -- this is not an admin issue, except for the damned lousy
condition of your man pages, which is secondary, so please start reading
comp.unix.shell, i will not respond again to a cross-posted article of
yours]

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.

yls177

unread,
Jan 27, 2003, 12:42:19 AM1/27/03
to
those who know me have no need of my name <not-a-rea...@usa.net> wrote in message news:<m1heccf...@usa.net>...

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?

Umberto Quaia

unread,
Jan 27, 2003, 4:00:24 AM1/27/03
to
"yls177" <yls...@hotmail.com> wrote in message news:c06e4d68.03012...@posting.google.com...

> 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


Doug Freyburger

unread,
Jan 27, 2003, 11:18:23 AM1/27/03
to
yls177 wrote:
>
> 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?

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.

John Wingate

unread,
Jan 27, 2003, 6:14:42 PM1/27/03
to
Doug Freyburger <dfre...@yahoo.com> wrote:
> 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 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

yls177

unread,
Jan 27, 2003, 7:41:32 PM1/27/03
to
dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...

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

Tim Cargile

unread,
Jan 28, 2003, 6:04:49 AM1/28/03
to
yls...@hotmail.com (yls177) wrote in message news:<c06e4d68.03012...@posting.google.com>...

> dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...
> > yls177 wrote:
> > >
> > > 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?
> >
[...]

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

Doug Freyburger

unread,
Jan 28, 2003, 10:51:03 AM1/28/03
to
yls177 wrote:

> Doug Freyburger wrote:
>
> > 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.
> > So, to see what will appear in /.temp, logout and log back in again.
>
> 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.

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.

Tim Cargile

unread,
Jan 28, 2003, 4:42:17 PM1/28/03
to
dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...
> yls177 wrote:
> > Doug Freyburger wrote:
> >
[..]

>
> Logout. Login. Inspect file. If that does not work, you have a broken csh.

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

Chris F.A. Johnson

unread,
Jan 28, 2003, 5:26:28 PM1/28/03
to
On Tue, 28 Jan 2003 at 21:42 GMT, Tim Cargile wrote:
> dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...
>> yls177 wrote:
>> > Doug Freyburger wrote:
> [..]
> I though csh has already been considered broken - globally.
[snip]

>> or by switching to a better shell.
>
> You really meant ANY shell didn't you?
> I vote for tcsh!

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

yls177

unread,
Jan 28, 2003, 8:34:41 PM1/28/03
to
dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...


where can i fixed the broken csh?

Tim Cargile

unread,
Jan 29, 2003, 2:20:37 AM1/29/03
to
yls...@hotmail.com (yls177) wrote in message news:<c06e4d68.03012...@posting.google.com>...
> dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...
> > yls177 wrote:
> > > Doug Freyburger wrote:
> > >
[...]

> > 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
[...]
> > 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.
>
[...]
>
> 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

Doug Freyburger

unread,
Jan 29, 2003, 10:35:19 AM1/29/03
to
yls177 wrote:
> Doug Freyburger wrote:
>
> > Logout. Login. Inspect file. If that does not work, you have a broken
> > csh. Fixed by downloading sources and building on your system
>
> where can i fixed the broken csh?

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.

Tim Cargile

unread,
Jan 30, 2003, 12:36:29 AM1/30/03
to
dfre...@yahoo.com (Doug Freyburger) wrote in message news:<7960d3ee.03012...@posting.google.com>...

Doh! :-)

0 new messages