[nmglug] Bash Scripting Help -- Thanks!!!
Karl Hegbloom
karlheg at laclinux.com
Thu Apr 7 07:33:14 PDT 2005
On Thu, 2005-04-07 at 00:15 -0700, Tim Emerick wrote:
>
> The only thing I don't like is the timing feedback where it will echo "1
> minutes" instead of "1 minute". Anybody have any tips on that.
You basically just need an "if" statement that tests for how many, and
pluralizes for > 1. If you wanted to write a subroutine for that that
takes the number and a word to pluralize, you'd have the problem that
not all words are pluralized by simply appending an 's' to them. The
other thing is that the grammatical "number" of the output sentence also
needs adjustment. The simplest solution is to pass the number and two
messages --- one singular, the other plural.
> I'm a little anal retentive if you couldn't already tell.
What's wrong with that? I call it "attention to detail".
> #################################################################################
> # Loop through directories in reverse order. If too old then delete else
> # rotate.
> #################################################################################
What happens if you delete a file, but don't notice it for 10 day? Your
backups rotate out, and you lose it entirely. I think this problem is
likely not completely solved by any backup system other than use of a
version control system such as CVS, Subversion, or GNU Arch.
More information about the nmglug
mailing list