Re: du

[prev] [thread] [next] [lurker] [Date index for 2005/10/01]

From: Smylers
Subject: Re: du
Date: 09:38 on 01 Oct 2005
Luke Kanies writes:

> On Fri, 30 Sep 2005, Smylers wrote:
> 
> > For example, suppose this directory contents:
> >
> >   $ mkdir new
> >   $ cd new
> >   $ touch aa bb '[ab]*' '[ef]*'
> 
> I don't know if that's hateful, but I can definitively state that it's
> evil.

Well I did say that it's a pathological case, but it's enough for me to
hate the default 'Bash' behaviour of 'globs are expanded unless they
don't match anything in which case they are passed through unchanged'.

'C Shell' got this right to start with; 'Bash' introduced nullglob in
version 2, which as noted in this thread helps in some situations and
makes others worse, and took until version 3 to come up with failglob.

At least, I believe it was version 3, from reading the changelog when it
came out.  I have access to this computer which has failglob:

  $ shopt failglob
  failglob        on
  $ ^X^V
  GNU bash, version 2.05b.0(1)-release (i386-portbld-freebsd4.10)

And this one which doesn't:

  $ shopt failglob
  bash: shopt: failglob: invalid shell option name
  $ ^X^V
  GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)

I hate that these are apparently the same version number, yet have
different features.  bash(1) on both computers ends with:

  GNU Bash-2.05b                   2002 July 15

I've just diff-ed them.  This itself was hateful, cos of spurious
formatting differences in the output, but having search-and-replaced
them out the only differences in the text are:

* The Red Hat one has an --rpm-requires option.
* The FreeBSD one in the 'Pathname Expansion' subsection there is this
  summary of failglob between the sentences on nullglob and nocaseglob:

    If the failglob option is set, and no matches are found, an error
    message is printed and the command is not executed.

And that's it!  The FreeBSD bash(1) doesn't even include failglob in the
big list of options under the shopt command!  There are an infinite
number of version numbers available -- if you're adding a feature, it's
hateful not to adjust the version number in some way.

Smylers
-- 
May God bless us with enough foolishness to believe that we can make a
difference in this world, so that we can do what others claim cannot be done.

There's stuff above here

Generated at 16:00 on 04 Oct 2005 by mariachi 0.52