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

Re: better init.d/* : who carres ?



On Thu, Aug 25, 2005 at 12:09:32PM -0300, Henrique de Moraes Holschuh wrote:
>>> 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
> Huh?  Anyone that has problem with that sed expression really has no
> business touching initscripts IMHO.

...

I've been using sed since 1997, IIRC. I still don't grok that expression
fluently. Are you saying that people who don't read the (IMHO rather arcane)
sed regex syntax, "having problems" with such syntax, shouldn't touch
initscripts? At the very least, it should commented that what is does is
indeed converting "(whatever) --foo=bar (whatever)" to "bar" when $1=foo.

/* Steinar */
-- 
Homepage: http://www.sesse.net/



Reply to: