[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] shell globbing (was Re: Beginner help request)
From: |
Adam Spiers |
Subject: |
Re: [Gnu-arch-users] shell globbing (was Re: Beginner help request) |
Date: |
Sun, 11 Jan 2004 20:14:11 +0000 |
User-agent: |
Mutt/1.4.1i |
Florian Weimer (address@hidden) wrote:
> Adam Spiers wrote:
> > pdksh% echo *.nothere
> > *.nothere
> > pdksh% echo $?
> > 0
> >
> > Broken and apparently unfixable.
>
> It's not broken, it's just surprising (to you).
I was never surprised by it.
> POSIX requires this behavior:
>
> | If the pattern contains an invalid bracket expression or does not match
> | any existing filenames or pathnames, the pattern string shall be left
> | unchanged.
I stand by my assertion that it's broken, and hence that POSIX is
broken too. Of course there's an implicit "IMHO" here, but not so "H"
given than my "O" is apparently shared by Tom ;-)
As he already pointed out, leaving the pattern string unchanged
follows the principle of most surprise, which is a Bad Thing. If the
expansion is undesired (such as in the rsync/scp example), then it can
be prevented deterministically via quoting. If it is desired, then
something sensible should happen when there is nothing to expand to -
either expand to the empty string or raise an exception. Can you
think of any practical real world example where either of these
behaviours would be less desirable than the POSIX behaviour?
- [Gnu-arch-users] Beginner help request, Oliver Crow, 2004/01/10
- Re: [Gnu-arch-users] Beginner help request, Tom Lord, 2004/01/10
- Re: [Gnu-arch-users] Beginner help request, Florian Weimer, 2004/01/10
- Re: [Gnu-arch-users] Beginner help request, Oliver Crow, 2004/01/10
- Re: [Gnu-arch-users] Beginner help request, Tom Lord, 2004/01/10
- Re: [Gnu-arch-users] Beginner help request, Dustin Sallings, 2004/01/11
- Re: [Gnu-arch-users] Beginner help request, Tom Lord, 2004/01/11
- [Gnu-arch-users] shell globbing (was Re: Beginner help request), Adam Spiers, 2004/01/11
- Re: [Gnu-arch-users] shell globbing (was Re: Beginner help request), Florian Weimer, 2004/01/11
- Re: [Gnu-arch-users] shell globbing (was Re: Beginner help request),
Adam Spiers <=
- Re: [Gnu-arch-users] Beginner help request, Andrew Suffield, 2004/01/11
- Re: [Gnu-arch-users] Beginner help request, Tom Lord, 2004/01/11
- Re: [Gnu-arch-users] Beginner help request, Dustin Sallings, 2004/01/11
- [Gnu-arch-users] Re: Beginner help request, Stig Brautaset, 2004/01/10
Re: [Gnu-arch-users] Beginner help request, Brian May, 2004/01/11