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

Re: what is truth?



On Sat, Oct 10, 2015 at 5:24 AM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> test ()
> {
> [[ "$1" = <-> ]]  && echo true
> }
>
> I don't have a clue what to make of ' <-> '.  What value
> would work?

In zsh pattern matching, <x-y>, where x and y are numbers, it matches
a number (of any length) between x and y, numerically. If you leave
either end out, that end is open. So <-> matches a numeric expression
of any length, viz

% test abc
% test 123
true
% test 123abc

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author