Re: Add option to just print history, with no added timestamps or line n
From:
Martin D Kealey
Subject:
Re: Add option to just print history, with no added timestamps or line numbers
Date:
Mon, 25 Mar 2024 02:04:22 +1000
Hi Dan
How about « fc -ln » ?
It might be helpful to have explicit cross-references between the help
displays for «history» and «fc».
-Martin
On Sun, 24 Mar 2024 at 15:40, Dan Jacobson <jidanni@jidanni.org> wrote:
> $ help history
> should mention how in the world one is supposed to just print the plain
> history,
> without any line numbers or time stamps.
>
> You might say, "Just strip it off with perl or sed." Well, fine. Then
> mention that in help history.
>
> Currently one needs massive superfund environmental clean-up effort
> workarounds, e.g.,
> $ HISTTIMEFORMAT=' ' history | perl -pwle 's/^\s+\S+\s+//'
>
> Better yet, add a
> history -j: Just print history, with no added timestamps or line numbers,
> etc.
>
> Or OK, there's HISTTIMEFORMAT. How about also a HISTFORMAT (default " %5n
> %t %h\n" or whatever,) so one could use "%h\n" for "just give me the
> history item."
>
>