<<< Date Index >>>     <<< Thread Index >>>

Re: macro just won't work!



On 2005-10-07, jhelfman@xxxxxxxxxxxxxx wrote:

> On Fri, Oct 07, 2005 at 10:56:12AM -0700, Gary Johnson thus spake:
> > On 2005-10-07, jhelfman@xxxxxxxxxxxxxx wrote:
> > > Here is what I am pasting into the limit command
> > > 
> > > ~f nagios|~f websitepulse |~s FDC |~t oncall |~t monitor.domain.domain
> > 
> > I have something similar.  Try this:
> > 
> >     macro index \Cm '<limit>(~f nagios|~f websitepulse |~s FDC |~t oncall 
> > |~t monitor.domain.domain)<Return>'

> Great that worked. Why did what I have not work? If you could explain, that
> would be great...

I don't know.  You didn't give a lot of precise examples of what you 
did try.  Your first example,

    macro index \Cm '<limit>~f "e...@xxxxxxxx ~f ema...@xxxxxxxx ~s TEST ~t 
ema...@xxxxxxxx ~t ema...@xxxxxxxx ~t ema...@xxxxxxxx"<enter>'

may have failed because the double-quotes make most of the string an 
argument of the first ~f.  When you said,

    I've also worked and just using the ticks, and removing the 
    quotes.  That doesn't work either.

I could only speculate on where you might have put the ticks and/or 
quotes.  If you really want an explanation of why what you did did 
not work, you'll have to show exactly what you did.  It also often 
helps to explain what the result was and what you expected.

I found I couldn't explain why the parentheses were needed in my 
solution, so I removed them and the result seems to work just as 
well.

When complicated commands such as your macro don't work the first 
time, I often find it useful to greatly simplify some part of it 
(usually the pattern or regular expression) to the point where I'm 
sure I understand how it should work and can easily spot any error.  
Then I gradually add complexity until I discover the part I did 
wrong and what I didn't understand the first time.

Regards,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA