Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [ -f glob ]
- X-seq: zsh-users 12411
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: [ -f glob ]
- Date: Thu, 10 Jan 2008 09:58:02 +0000
- In-reply-to: <20080110044842.63406.qmail@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080109091335.49226.qmail@xxxxxxxxxxx> <200801091239.m09CdmR9003125@xxxxxxxxxxxxxx> <20080110044842.63406.qmail@xxxxxxxxxxx>
Atom Smasher wrote:
> On Wed, 9 Jan 2008, Peter Stephenson wrote:
>
> > This is broken: -f expectes exactly one argument and you're giving it an
> > expression that expands to multiple arguments.
> ================
>
> but, why would it work on bsd and not work on solaris?
You're into implementation-specific land, from whose Bourne shell no
traveller returns.
Schematically, you've got something like
[ -f file1 file2 file3 ]
(number not that important). The "-f file1" is a valid test. At the
file2 I would expect the test implementation simply to give up and
return an error, but there is so much hackery to get round the fact that
keywords in the test aren't syntactically marked and that the default
test is for a non-empty string even, in some cases, if the string looks
like a keyword that I don't think it's worth worrying about, just
noting that "[" and "test" mean trouble.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author