Why cygwin's history output is prefixed by two spaces?
Sophoklis Goumas
olspookishmagus@gmail.com
Wed Jul 31 15:28:41 GMT 2024
On Tue, 30 Jul 2024 at 12:35, Hans-Bernhard Bröker <hbbroeker@gmail.com> wrote:
>
> Your conclusion about there being some extra prefix is premature.
>
Indeed it is, please excuse me.
> That's just the number of the history entry, padded up to 5 characters
> with spaces for better alignment (as in
>
> printf("% 5d", ...)
That might've been better if it were "%05d" and I also wonder what will
happen if someone surpasses 99999 lines in his history file.
I think I'll have a look at binutils source.
This is because I'm trying to parse history output and I foolishly set
FS (field separator) to be two consecutive spaces '\ \ '.
I think I'll pass this to sed first and maybe replace with an unlikely
character to be found thereafter so these lines will be parseable or if
it's confirmed to be a hardcoded fixed width output I'll just use column
numbers.
I also hope this won't get mess the threads as I thought I was
subscribed to this mailing list so I am replying by hand and I don't
know if the right headers will be included, so please excuse as well,
if the threads get messed up.
Thanks for your time/energy/answer, Hans-Bernard,
Sophoklis
More information about the Cygwin
mailing list