Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: do not write certain commands to history file



On Wed, 25 Aug 2010, Mikael Magnusson wrote:

> On 25 August 2010 22:55, Benjamin R. Haskell wrote:
> > On Wed, 25 Aug 2010, Eric Smith wrote:
> >
> >> [...]
> >>
> >> zshaddhistory() {
> >>     [...trimmed...]
> >>
> >>     [[          [...trimmed...]
> >>         && ${arg} != (*foobar*)
> >>     ]]
> >> }
> >
> > Where are you setting $arg?  Do you mean $line? or are you trying to
> > match *foobar* in $argv?
> 
> What are you talking about?

See the portion of his original function I left above.


> There's no $arg anywhere, and no arrays.  zshaddhistory() is passed 
> the entire command line in a single argument.

Which is accessible via ${argv}, I suppose.  But, yeah, overkill.  I was 
thinking of finding *foobar* in a general function's $argv.

-- 
Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author