resource-agents
resource-agents copied to clipboard
Low: bash can do find and replace
Ok, shelling out to do find and replace when sh does it so easily urked me enough to write a patch.
tested with ./lvm.sh meta-data
is this a bashism?
Nope, all sh, substitution ${a//x/y} and removing prefix/suffixes ${a%%xx} / ${a#xx} in the other PRs
and aside from that #!/bin/bash is the header of each file here.
Note that while ${a#xx}, ##, %, %% are portable, ${a/x/y} is not. try yourself: dash -c 'X=AAA; echo ${X//A/B}'
Which means these changes are ok for any resource agent with #!/bin/bash, but not for those that announce themselves as #!/bin/sh
I did not check if you hit any of the latter, so your change may even be ok, and only the statement "all sh" was wrong...
thanks @lge for the corrections. Will keep that in mind. Good to know dash does a good test.