bug-bash
[Top][All Lists]
Advanced

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

Re: Multiline commands do not survive history -w/-r


From: Chet Ramey
Subject: Re: Multiline commands do not survive history -w/-r
Date: Mon, 12 Jun 2017 11:09:38 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 6/11/17 9:00 PM, address@hidden wrote:

> Bash Version: 4.3
> Patch Level: 48
> Release Status: release
> 
> Description:
>       Multiline commands (i.e., a command with embedded newlines) do not 
> survive
>       intact when written out to the history file and then reloaded.

Yes, the history file format is explicitly line-oriented.  Bash-4.4
introduced a heuristic that allows multi-line history entries to work
without changing the file format or introducing an additional special
character.  From the NEWS file:

k.  If readline reads a history file that begins with `#' (or the value of
    the history comment character) and has enabled history timestamps, the
    history entries are assumed to be delimited by timestamps.  This allows
    multi-line history entries.

You enable history file timestamp writing by having HISTTIMEFORMAT set. It
can have a null value.

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



reply via email to

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