On 10/11/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> On 10/9/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> > On 10/9/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> > > On 10/8/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> [...]
> > > How abot this.  Write a comment with a time stamp before each command,
> > > that begins with a signature like "fish command executed at " or
> > > something like that.  It would be easily parsable and documented.
> > > Then perhaps the backslash escapes can be avoided.
> > >
> >
> > If you did that, you'd have to somehow handle if the user writes out a
> > comment with a timestamp inside a command. The only real solution I
> [...]
>
> You can recognize such timestamp-comments and store them in modified
> form, so that they are no longer recognized as timestamps.  For
> example, prepend a #.  So the history would not contain exacly what
> the user entered, but this true of all the other options, and this
> version is much cleaner, I think.  We will rewrite history, in the
> name of the people.

We can either escape the '#' or the newline. Why is one better than the other?

>
> The second-best alternative is to store commands as single lines, as
> someone suggested.  When browsing history, blocks would always be
> expanded to multiple lines; or you need to store which ones to be
> expanded and which ones to stay as single lines.
>
> > A third possibility I've considered is to escape each command in the
> > history, but that would severely reduce the greppability of the
> > history file.
>
> Escape how?

Regular backslash escapes. For example:

echo 'first
second…'
#comment

becomes

echo \'first\nsecond\u2026\'\n\#comment

Not very grep friendly, but easy enough to parse and understand.

-- 
Axel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to