[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rm - bug or user error?
From: |
Alan Curry |
Subject: |
Re: rm - bug or user error? |
Date: |
Tue, 26 Jan 2010 21:12:27 -0500 (GMT+5) |
Jon Stanley writes:
>
> Yeah, like Eric said, I think that this is a csh problem rather than a
> coreutils problem. I would even think that csh is behaving wrongly
> here - rather than refusing to run rm because the glob didn't match,
> it should pass the f* straight through to rm to deal with as it
> pleases, unless you explicitly told the shell to fail (as Eric did in
> his example). I don't have any standards to back that up though, Eric
> is the POSIX-citing guy around here :)
>
> Any standards for that Eric?
csh is not Bourne shell. This is one of the things that csh got right, which
Bourne shell had wrong[1]. Sadly Bourne's behavior got the blessing of POSIX
and csh didn't. But csh isn't being wrong here, just being csh.
[1] Consider, in a Bourne/POSIX style shell, how different the two possible
behaviors are for:
grep a.*b foo
depending on whether the word a.*b matches as a glob or not. People write
junk code like this, it "works" because of the old Bourne shell misfeature of
passing non-matching globs straight through, and then much later it
mysteriously breaks because a file called "a.b" has been created. We'd be
much better off if non-matching globs had always been treated as errors.
--
Alan Curry
Re: rm - bug or user error?, Eric Blake, 2010/01/26