Scott McDermott wrote:
>
> Camm Maguire on Tue 7/03 17:59 -0500:
> > --- autofs-3.1.4.orig/samples/rc.autofs.in
> > +++ autofs-3.1.4/samples/rc.autofs.in
> > @@ -106,7 +106,10 @@
> > if [ ! -z "$dir" -a ! -z "$map" \
> > -a x`echo "$map" | cut -c1` != 'x-' ]
> > then
> > - map=`echo "$map" | sed -e 's/^auto_/auto./'`
> > + if echo $map | grep ^auto_ >/dev/null && \
>
> Not all maps are named auto*. Try "egrep '^[[:alnum:]]+_'"
>
> But now that I think of it, there is really no reason for this line at
> all.
>
The transformation _ -> . (which I think should be done for all
underscores) should be done for "yp" (not "file", not "program", not
"nisplus") maps only.
> > + [ $(ypcat $map 2>/dev/null | head | wc -l) -eq 0 ] ; then
>
> Please do not use $() as this is bash-only. Not everyone has bash
> installed, although I will grant you that most people in the GNU
> universe do :) I have run into people that use zsh as their /bin/sh,
> for example.
>
Actually $() is POSIX.
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."