[RULE] Need help with scripting Vacuum

Geoff Burling llywrch at agora.rdrop.com
Fri Dec 13 03:27:11 EET 2002


On Thu, 12 Dec 2002, Eugene Wong wrote:

> >From: Geoff Burling <llywrch at agora.rdrop.com>
> >
> >Have you looked at ``getopt"? That may be what you're looking for. I've
> >toyed with it once or twice, but the examples included in the documentation
> >aren't very good.
>
> You got examples?! That must mean good fortune has descended upon you! :^)

Well, the examples I have are technically better than no examples at all --
take a look at /usr/lib/getopt/parse.bash & see what I mean.
>
> Well, at your suggestion, I took a look at it. I think that it is what I am
> looking for, but I'm not entirely sure about how to use it. I'm thinking
> that it might be a waste of time trying to learn for the sake of this
> script. It seems to be taking longer than I anticipated. I was hoping to get
> it done last weekend. I'd like to get it done as soon as possible, so that I
> can start working on a variation of Slinky, & then maybe make some
> contributions to rpm [the actual project for the binary].
>
> Also, as I typed out the previous paragraphs, I thought that maybe this type
> of script doesn't need getopt, because it would only require 1 option at
> most, plus any other file names. Maybe we could make Vacuum require at least
> 1 option, no matter what, so that it would make life easier for us to write
> code that directly tries to deal with ${1}, and if there are no options
> given, then it could just display usage & help information.
>
> What does everybody think?
>
If you are just thinking of one flag or option to the script, take a look
at the K & S scripts in /etc/rc.d/init.d: they all use the "case" branching
command to do what you're thinking about. And it will be much easier to
implement than getopt.

Geoff



_______________________________________________
Original home page of the RULE project: www.rule-project.org
Original Rule Development Site http://savannah.gnu.org/projects/rule/
Original RULE mailing list: Rule-list at nongnu.org, hosted at http://mail.nongnu.org/mailman/listinfo/rule-list




This full static mirror of the Run Up to Date Linux Everywhere Project mailing list, originally hosted at http://lists.hellug.gr/mailman/listinfo/rule-list, is kept online by Free Software popularizer, researcher and trainer Marco Fioretti. To know how you can support this archive, and Marco's work in general, please click here