[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: history shows edited lines not the lines actually ran

From: Chet Ramey
Subject: Re: history shows edited lines not the lines actually ran
Date: Mon, 18 Jun 2018 09:29:56 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 6/16/18 1:23 PM, address@hidden wrote:

> Bash Version: 4.2
> Patch Level: 46
> Release Status: release
> Description:
>       when you edit a line from your bash history, history shows the edited 
> version, even if you never ran it

Yes. Each in-memory history entry can be edited aribitrarily, and each has
an individual list of changes to undo (if you see an asterisk preceding a
history entry when you list the history lines, it means the line has been
modified). When you execute a modified history line, readline reverts the
line to its original state by unwinding the changes. You can set the
`revert-all-at-newline' variable to force readline to undo all  changes to
modified history lines whenever it reads a newline and returns.

By default, the history library writes the contents of the in-memory
history list to the history file, including modified lines. If you don't
want this, set `revert-all-at-newline'.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]