Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: globbing in conditional expressions



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