bug-bash
[Top][All Lists]
Advanced

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

Re: multi-line commands in the history get split when bash is quit


From: Jon Seymour
Subject: Re: multi-line commands in the history get split when bash is quit
Date: Sun, 6 Feb 2011 13:12:47 +1100

On Sun, Feb 6, 2011 at 1:07 PM, Michael Witten <address@hidden> wrote:
> On Sat, Feb 5, 2011 at 20:02, Michael Witten <address@hidden> wrote:
>> So, if you run `history', you'll not only get the commands in the
>> history list, but you'll also get the time at which the commands
>> were last run (formatted according to "$HISTTIMEFORMAT").
>>
>> In other words, it's not helpeful in this case.
>
> Of course, I suppose bash could be taught to build multi-line comments
> from command lines that share the same timestamp, but given the nature
> of how that information is recorded, it seems like it may not be a
> very robust solution.
>

You don't have to do that - the timestamp is encoded in a "comment"
line between entries. See the example below. One could simply assume
all lines between two lines beginning with # are part of the one
entry,

#1296950290
pwd
#1296950293
bash -version
#1296950327
for i in 1 2
do
echo $i
done
#1296950337

jon.



reply via email to

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