Perl monking (was Menu{Master,Maestro,etc} question(s)
Fairlight
fairlite at fairlite.com
Mon May 14 12:11:30 PDT 2007
Four score and seven years--eh, screw that!
At about Mon, May 14, 2007 at 03:02:04PM -0400,
Jay Ashworth blabbed on about:
> On Mon, May 14, 2007 at 02:56:09PM -0400, Jay R. Ashworth wrote:
> > I actually ended up with:
> >
> > perl -pi.bak -e 'BEGIN {$label=shift; $sub=shift;}
> > if (/^$label:/)
> > s/^(.+:[^:]+")[^"]+(".*)/$1${sub}$2/;' $2 $3 $1
> >
> > You forgot the if clause. The trailing semicolon, too, in the -e, but
> > I suspect that's optional.
> >
> > Testing now.
>
> And teh answer is:
>
> MsUs-1:/appl/filepro/dddtmp # mmreplace ./prc.jra tstdate replacement
> syntax error at -e line 3, near ")
> s/^(.+:[^:]+")[^"]+(".*)/$1${sub}$2/"
> Execution of -e aborted due to compilation errors.
>
Put {} around the action in the if statement; this ain't python.
m->
--
No matter what your problems, modern medicine can help!
http://members.iglou.com/fairlite/fixital/
More information about the Filepro-list
mailing list