On Aug 24, 2005, at 6:43 PM, sean finney wrote:
On Wed, Aug 24, 2005 at 05:22:32PM +0100, Andrew Porter wrote:
/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.
that's not completely true, unless knowledge of sed also implies a good
understanding of posix regular expressions, in which case i wouldn't be
so hasty to claim it was easier to understand.
however, all of this notwithstanding, if someone takes the time to
submit a patch similar to this it will probably be included.
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....
it is a /bin/bash script, so i suppose bashisms are allowed, provided
that there aren't other reasons christian or i would object to them.
Aren't the init-scripts supposed to be posix-compilant? Often when
installing dash as /bin/sh this becomes a problem because even though
dash is posix-compatible it tends to break init-scripts for me. Whether
this is dash's fault or the init-scripts is beyond my knowledge since I
don't
know POSIX very well. But still I think bashisms should be avoided.
sean
mauro
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]