Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.bugs.4bsd Subject: Re: csh history bug Message-ID: <11192@mimsy.UUCP> Date: 23 Apr 88 13:04:25 GMT References: <1245@ucsfcca.ucsf.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 38 In article <1245@ucsfcca.ucsf.edu> rk9005@cca.ucsf.edu (Roland McGrath) writes: -Repeat-by: - $ csh -f - % set history=5000 - % echo foo - foo - % ^foo^bar - echo bar - bar - % history - 1 set history=5000 - 2 echo foo - -1000 echo bar 3 echo bar - 4 history - % - - Any large value for `history' will do it. I have been unable to find -the exact threshold, but anything larger than 2000 will always work, I think. Not quite. Anything more than 1000+next_event+2 suffices. (I.e., if this is the very first command, 1004 is enough.) The history number `-1000' should give a large hint. If you look in /usr/src/bin/csh/sh.lex.c you will find where csh enters substitution events as number -1000. The idea is that since -most people don't set history to a big number, the negative event will be discarded from the history list since it occurred over 1000 commands ago. -Aside: Can anyone with source access tell me what type is used for the -value of `history', so I can make it 32767 or (2^31) - 1, or whatever? `int', of course. The variable itself is a string, but it is converted to an integer whenever needed (once per command!). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris