Re: Shell hate (was Re: unzip hate)

[prev] [thread] [next] [lurker] [Date index for 2007/02/20]

From: Smylers
Subject: Re: Shell hate (was Re: unzip hate)
Date: 17:11 on 20 Feb 2007
Robert Rothenberg writes:

> On 20/02/07 15:37 Abigail wrote:
> 
> > Perhaps you suffer from the fact that your shell is expanding the *?
> 
> You're right. My mistake.

A shell which expands a pattern if it can or otherwise (silently)
pretends that you quoted it is hateful.  Apart from anything else, the
silent-pretend-quoting lulls people into a false sense of security, so
they end up using it when it does match something.

Bash 3 introduced the failglob option

  $ shopt -s failglob

When set it means that a pattern will either be expanded or if nothing
matches will give you an error; if you want to treat a pattern as a
string you have to quote it.

(Don't confuse this with the nullglob option, which (silently) pretends
that non-matching patterns never existed, running the command with
nothing in the place where you typed the pattern; that's also hateful.)

TC Shell had a failglob-equivalent years ago.  Bash hatefully took until
the relatively recent version 3 to catch up.  And, hatefully, it isn't
the default (for obvious reasons, I accept, but that doesn't make it not
hateful).

Smylers
There's stuff above here

Generated at 06:02 on 21 Feb 2007 by mariachi 0.52