bug-bash
[Top][All Lists]
Advanced

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

using perl's gnu-readline interface, howto 'completion' & 'filter histor


From: Linda Walsh
Subject: using perl's gnu-readline interface, howto 'completion' & 'filter history'?
Date: Fri, 09 Jan 2015 12:33:07 -0800
User-agent: Thunderbird

I have a little calculator interface that I use readline for.
Imagine my surprise when I type 1+<TAB> and get a list of files
to add to 1.  Um... not ideal?

I add a time/date stamp to each line typed in.
(HISTTIMEFORMAT="%m%d@%H%M%S:")

In bash when I scroll back, I don't the time
entries, but I do in my calculator.  How can I filter
them out?

In the hist files for bash I see:
#1382638179
ps  -ef|grep fetch
#1382638179
ps  -ef|grep fetch
#1382791092
more /etc/rc.d/ipmi_hw_mond
--------------------
and in my calc, I see:

#1413135046
use Math::Simple
#1413135059
logb(2,1)
#1413135080
logb(2,1.1)
#1413135113
log2=log(2)

---
They look similar, but I don't see why bash suppresses them, but
my calc doesn't.  Is there an option to set in readline?

Note, I do set some options, but seem to need to write the timestamp
into the history file myself.
       $ra->{history_comment_char}='#';
       $ra->{history_expansion_char}="";
       $ra->{history_write_timestamps}=1;
       $ra->{history_quotes_inhibit_expansion}=1;

histfile update writes the time itself to get the time in the .hist file...

       if ($histfile_h) {
printf($histfile_h "#%d\n%s\n", CORE::time,$_) unless $_ eq 'quit';
           $histfile_h->flush;
       }

i.e. the write_timestamps option seems to be having no effect -- unless
it's writing another history file someplace else...?

It may just be the perlmod for this interface is a bit dated as well...but
thought I'd ask here first...

Thanks...





reply via email to

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