Deutsch English Français Italiano |
<vcuehc$37dtm$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.unix.shell Subject: Re: [ksh] Show command number in shell prompt Date: Tue, 24 Sep 2024 15:23:56 +0200 Organization: A noiseless patient Spider Lines: 36 Message-ID: <vcuehc$37dtm$1@dont-email.me> References: <vcuc9r$373il$1@dont-email.me> <slrnvf5dsq.2b4.hymie@nasalinux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 24 Sep 2024 15:23:57 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2840717624f99e06c1a845f4f7da582e"; logging-data="3389366"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oBnBzpJ0ojF4L3b07FEU0" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:KMhQEWOB0qiSg9B6TaY493J8cyM= In-Reply-To: <slrnvf5dsq.2b4.hymie@nasalinux.net> X-Enigmail-Draft-Status: N1110 Bytes: 2554 On 24.09.2024 14:59, hymie! wrote: > In our last episode, the evil Dr. Lacto had captured our hero, > Janis Papanagnou <janis_papanagnou+ng@hotmail.com>, who said: >> Not long ago I added an '!' (exclamation mark) to my prompt to have >> it get expanded to the command number [in Kornshell]; PS1='(!)$ ' >> The effect is that a new shell instance starts with the number 1000 >> which incidentally equals the HISTSIZE. - Any ideas what could have >> gone wrong here? > > Nothing has gone wrong. > > HISTSIZE=1000 means that the maximum size of your history is 1000. Once it > hits that level, the oldest entries are dropped, and the newest entries > are added to the end. > > So every command you issue is always the last command in the history. > Since the history is full, it's always command number 1000. Hmm.. - that explains, maybe, part of it. Thanks. I'm still irritated; if I see in one shell session a value of 11059 (which is an indication that the numbers created by '!' don't wrap) I'm astonished that the counting in a new window will start at 1000 (and not at 1 or at the maximum previous value). I've just closed a window with an actual maximum command number of 1643, and "restoring"[*] that window will continue at 1643. Still puzzling... Janis [*] Note: Closing a shell window and re-opening it anew will work on the previous, same history file.