Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing in conditional expressions
- X-seq: zsh-users 18784
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: globbing in conditional expressions
- Date: Wed, 7 May 2014 16:57:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qgv/9KU7Bu249qWvHI/5MYiBSv5FUozLLeTaHNZQJFY=; b=XwUh3Y4By0tyAsMlRIun7eY+vZqp4O0H6gPSIvEY5gVhB1DsypeTeH3HN+mTHR0yWh apWp8oBdj0vxrMS/QAKu4Y6llS6j4VpWgtjx7XGZRA10GD9EZ1SFyqPNvSpg03cBJkl+ s3Sm5wrnfVXMWKFO7M/xyxO71JFVqfhmpfx+CuffAyv96Iryj92Qpx9mJoBQgmerM1x9 3ddAEV2yl7ZnSC0QvRQ4EpwEgan2xNKBbS38NSh+7x9bOUpPN0qGmSfoC5bBGx9Av4k2 5Hgi+Oq/vzaoHSMcj4JxlakmvMKN7qR3iFCDsg7nR/OOonaRx+80lbWuH/VS4yKeKjnZ JDWg==
- In-reply-to: <20140507124101.GA53652@isis.sigpipe.cz>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20140507124101.GA53652@isis.sigpipe.cz>
On 7 May 2014 14:41, Roman Neuhauser <neuhauser@xxxxxxxxxx> wrote:
> hello,
>
> i was hoping i could combine conditional expressions with
> some globbing, but i'm struggling to find the proper syntax.
>
> : 0 > ls fubar
> snafu
> : 0 > f=fubar(/F)
> : 0 > echo $f
> fubar(/F)
> : 0 > echo $~f
> fubar
> : 0 > (set -x; [[ -z $~f ]])
> +zsh:183> [[ -z 'fubar(/F)' ]]
> : 1 >
>
> i'm sure this is possible and documented, and i've just failed
> to put the pieces together.
a=( myglob*(/FN[1]) )
(( $#a )) && yay files
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author