Re: perl one-liner issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>The problem is trying to pass valid Perl though the bash shell . There 
>is an insane amount of interaction between all the escapings involved in 
>this specific pattern. The hard problem is getting bash to *not* change 
>what you are passing to Perl before Perl sees it.

As I have noticed:)

>After enough poking and prodding you'll get something like this (after 
>giving up on getting bash to not molest the ' characters before passing 
>them to Perl):
>
>'s/(\$conf\[\047nagios_base\047]\s*=\s*")\/nagios\/cgi-bin";/$1stuffhere"\;/'

Yup, saw some notes like this, I ended up cheating with a couple of greedy
backreferences on both sides of the simple part of the match. Not exactly
error proof, but sufficient.

>Is there some reason you can't use a straight Perl script instead of 
>using bash to run a perl one liner?

Dunno, just always seen one liners in the %install section to fixup things
not adjustable by configure statements...

Thanks!
jlc
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux