Menu{Master,Maestro,etc} question(s)

Jay R. Ashworth jra at baylink.com
Tue May 8 19:37:34 PDT 2007


On Tue, May 08, 2007 at 04:48:08PM -0400, Fairlight wrote:
> On Tue, May 08, 2007 at 04:37:40PM -0400, Jay Ashworth may or may not have
> proven themselves an utter git by pronouncing:
> > (Off-list replies are fine if you don't want to divulge; I'm just trying
> > to decide whether the effort of reimplementing it is worthwhile. (And
> > yes, I know, we've had the "is it worth investing time in commercial
> > products for the filePro audience" conversation before, as well as how it
> > came out; let's skip the meta :-).))
> 
> *skips*  :)

Yup; that was mostly for you.

:-P

> > # mmreplace - use perl to fake a MenuMaster :replace: command
> > #
> > # written Tue May  8 16:23:19 EDT 2007 by jra at microsys.us
> > 
> > [ $# = 3 ] ||
> >         {
> >         echo "usage: $0 filename line-label replacement
> >         exit 1
> >         }
> > 
> > # the regex ahead is:
> > #
> > # label:if:var="contents"  :
> > # ''''','','''','''''''','',
> > # \1    \2 \3   \4       \5
> > 
> > perl -pi.bak -e "
> >         if (/^$2:/)
> >           s/([^:]):([^:]):([^\"])\"([^\"])\"([^:]):/\1:\2:\3\"$3\"\5:/;" $1
> > ========
> > 
> > 
> > If that's *correct* (I'm not a perlmonk), anyone who finds themselves in a
> > similar situation is welcome to it.  If it's *broken*, corrections would
> > be appreciated.
> 
> I'd have to see an illustration of what the functionality you're trying to
> implement actually is to know if it's right or not.

I'm trying to replace the contents of the single pair of double quotes
in between second and third colons.  See the example, with the commas
and apostrophes for delineation, and the backreferences below, above?

Oh, and only on the line starting with the label noted, which is the
part I'm least confident about.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274


More information about the Filepro-list mailing list