Perl monking (was Menu{Master,Maestro,etc} question(s)
Jay R. Ashworth
jra at baylink.com
Mon May 14 12:02:04 PDT 2007
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.
I *thought* it might be the unescapedness of those double quotes, but
quoting them doesn't change the error message.
Ideas?
--
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