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

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

On Wed, 2005-08-24 at 17:44 +0200, Peter Palfrader wrote:

I could debate with you whether

>         /usr/sbin/mysqld --print-defaults \
>                 | tr " " "\n" \
>                 | grep -- "--$1" \
>                 | tail -n 1 \
>                 | cut -d= -f2

is harder to read than

>      /usr/sbin/mysqld --print-defaults |
>      sed -ne "s/^.*--$1=\\([^ ]\\+\\).*\$/\\1/p"

Both require knowledge of a particular tools - one only one tool though.
Once you have that knowledge I would suggest that the single command
version is easier to read (though I personally would use awk).
Also, in pursuit of faster boot times, the single process solution is
more keen.

Of course this would all be so much simpler if we could actually use the
power of modern shells (post 1993) in init scripts - subprocesses
wouldn't be required at all....

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: