cvs commit: src/etc rc.subr src/share/man/man8 rc.subr.8
Florent Thoumie
flz at FreeBSD.org
Wed Jun 21 11:22:52 UTC 2006
On Wed, 2006-06-21 at 13:17 +0200, Stefan Farfeleder wrote:
> On Wed, Jun 21, 2006 at 12:05:09PM +0100, Florent Thoumie wrote:
> >
> > Then I'm not sure what script would benefit from this function. Can you
> > point me to an example?
> >
> > > > I don't have a particular feeling against your function but it uses
> > > > commands that may not be available early enough (getopt, egrep). While
> > > > it's easy to remove the getopt dependency (see rc.d/mdconfig), it's not
> > > > the case for egrep.
> > >
> > > It's POSIX getopts, which ought to be a shell built-it by its design.
> > > egrep is used with -e only, one can avoid using it if egrep isn't
> > > available yet. The only issue is true and false, I was sure they
> > > were in /bin, but it can be fixed easily.
>
> true and false are builtins for /bin/sh.
>
> >
> > Still, with /bin/sh, getopt isn't a builtin:
>
> getopt != getopts
Oops. Misread that.
> > $ sh -c 'which getopt'
> > /usr/bin/getopt
>
> /bin/sh doesn't have a which builtin, so you are executing /usr/bin/which which
> just looks in $PATH. Try 'type getopts'.
Bleh, bites me everytime.
Thanks!
--
Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20060621/822be874/attachment.pgp
More information about the cvs-src
mailing list