Hello Vapier, would You mind to stop changing "if ... ; then" to "if ... then" with every update back and forth? Thank You, Dominik
Hi SpanKY, btw. thanks for all the work You do!! But I see no reason to change sth. like - if [ -e /etc/conf.d/local.stop ] - then + if [[ -e /etc/conf.d/local.stop ]] ; then either, as "[[ ... ]]" in this case just will not do word splitting and filename expansion (and more?), which would not occur anyways because there are no variable parts in this file name, and I find it much clearer to write if test -e "$somefileVar"; then instead of if [[ -e $somefileVar ]] Though the latter nicely shows the capabilities of bash, putting "" around filename variables will work everywhere... but it doesn't make a difference here. +# $Header: /var/cvsroot/gentoo-src/rc-scripts/init.d/localmount,v 1.29.4.2 2005/02/19 19:47:53 vapier Exp $ ... + local usbfs=$(grep -Fow usbfs /proc/filesystems || + grep -Fow usbdevfs /proc/filesystems) ... + if [[ -n ${usbfs} ]] && \ + [[ -e /proc/bus/usb && ! -e /proc/bus/usb/devices ]] You might as well be interested in grep's "-q / --quiet" option, which does not output anything... though in this case You certainly want output. Consider combining multiple grep searches into one with "-e ... -e ...", as this would be two less fork()/exec()s in this case -- doesn't matter on todays hardware, but on some old 486 (or even 386) all those expenses will sure hurt performance: local usbfs=$(grep -Fow usbfs /proc/filesystems || grep -Fow usbdevfs /proc/filesystems) => local usbfs=$(grep -owe usbfs -e usbdevfs /proc/filesystems) or local usbfs=$(grep -owEe 'usb(dev)?fs' /proc/filesystems) And maybe (though there should only be one of them in /proc/filesystems) a combination with "-m 1"... but I'm getting way too deep into it. Regards, Dominik
Hi, if this is going to be an argument, my opinion is to keep the "then" on the same line :-)
ive never written code of the form if ... then regardless, see the STYLE file in baselayout
thanks for the hint, but I didn't find "style" in baselayout: equery files baselayout | while read f rest; do test -L "$f" -o -d "$f" && continue test ! -e "$f" && continue echo "$f" done | xargs -r grep -i --color=tty -e style Would You mind to give me another hint? No matter if You do: thanks, sorry to take Your time! Dominik
closing bug, may be purged from the DB. (New status should be closed invalid.)