Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!ames!pasteur!ucbvax!ucsfcgl!cca.ucsf.edu!rk9005 From: rk9005@cca.ucsf.edu (Roland McGrath) Newsgroups: comp.bugs.4bsd Subject: csh history bug Message-ID: <1245@ucsfcca.ucsf.edu> Date: 23 Apr 88 01:27:28 GMT Reply-To: roland@rtsg.lbl.gov (Roland McGrath) Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 26 Index: 4.3 BSD and Sun 3.2 (and greater, probably), csh I have repeated this on 4.3 BSD Vaxen and Sun Unix 3.2 Sun 3/50s. 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. I guess most people don't set history to a big number, so they haven't noticed it. This will also happen using `!!:s/foo/bar' or '!2:s/foo/bar', as well as with the trailing ^ or / appended. 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?