** Peter Palfrader :: > > mysqld_get_param () { > > /usr/sbin/mysqld --print-defaults | > > sed -ne "s/^.*--$1=\\([^ ]\\+\\).*\$/\\1/p" > > } > > And harder to read. Making scripts more complex and harder to > read for some dubious efficiency is not a good idea in my opinion.
I respectfully disagree, especially in the example case, in the following counts: 1. In the example case, we have four pipes (five concurrent processes), and here we have only one, which I think settles the performance gain in the "non-dubious" zone. 2. In the example case, one regexp in the sed command-line explains quite clearly what you want to extract from the output of print-defaults, which I think settles the case for the "making scripts more complex and harder to read". I was still in doubt of what the script extracted from the output of print-defaults until I saw the regexp. If I was the DD in charge, I would apply the patch. -- HTH, Massa -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]