Mailing List Archive

Antw: Re: A little tip about crm configure filter ?
>>> Moullé Alain<alain.moulle@bull.net> schrieb am 08.01.2014 um 10:10 in
Nachricht
<52CD160B.6060402@bull.net>:
> Thanks Kristoffer,
>
> works fine but ...
> I also needed to execute the command in a perl script such as :
> `crm -F configure filter \"sed '/threshold="1"/s/="1"/="0"/g'\"`
>
> but it seems also difficult to make it work with the mandatory CR and
> <<END and END flags inside ...
> :-\

In Perl you need no quoting if you don't use shell metacharacters. I.e. Use
the multi-argument variant of system. See "perldoc -f system".
Don't make it more complicated than necessary ;-)
Ulrich

>
> Alain
>
> On Tue, 7 Jan 2014 10:35:10 +0100 Moullé Alain <alain.moulle@bull.net>
> wrote:
>>> Hi,
>>>
>>> I'm fighting with the crm configure filter command to change all
>>> migration-threshold values in the configuration :
>>>
>>> crm -F configure filter \"sed '/threshold="1"/s/="1"/="0"/g'\"
>>>
>>> does not change anything , and I've tried to add several \ around the
>>> " , around the = etc. nothing works ...
>>>
>>> whereas if I execute the sed command on a resulting file of command
>>> crm configure show, sed command works :
>>> sed '/threshold="1"/s/="1"/="0"/g'
>>>
>>> can someone tell me the tip to make it works with crm configure
>>> filter ?
>> Hi,
>>
>> Unfortunately bash quoting makes it really tricky to get the input
>> right. It's easier to do this through the interactive shell. The
>> following variant should work:
>>
>> crm configure <<END
>> filter "sed '/threshold=\"1\"/s/=\"1\"/=\"0\"/g'"
>> END
>>
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems


_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems