Sujet : Re: Rationale for aligning data on even bytes in a Unix shell file?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 27. Apr 2025, 01:51:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vujv1l$3ieue$1@dont-email.me>
References : 1 2
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 27.04.2025 01:35, Kaz Kylheku wrote:
On 2025-04-26, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
In a "C" file (of the Kornshell software) I stumbled across this
comment: "Each command in the history file starts on an even byte
and is null-terminated."
[...]
The alignment could be of help if you're looking at the file
with "od -tx2a".
Well, the intention was more to get some better readable text from
ksh's history file. That annoyed me for long, and when I recently
read in CUS Kenny's question about GNU grep and \0 it reminded me
to have a closer look into ksh's format. As Keith mentioned, we do
not have *that* issue with Bash's format, but for Ksh I'd like to
have some tools (e.g. a grep, editing macros, etc.) to handle such
files in a simpler (text-)way (without touching its native format).
As it seems Ksh's history format (while "binary") is quite primitive
so it won't be a big deal, I suppose; skip the markers and split on
the nulls.
Janis