Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: test if a parameter is numeric
- X-seq: zsh-users 11209
- From: "Com MN PG P E B Consultant 3" <mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx>
- To: "Lydgate" <zsh@xxxxxxxxxxxxxxxxxx>, <zsh-users@xxxxxxxxxx>
- Subject: RE: test if a parameter is numeric
- Date: Tue, 20 Feb 2007 08:02:59 +0100
- In-reply-to: <E1HJIfJ-0002Ok-Ql@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <E1HJIfJ-0002Ok-Ql@xxxxxxxxxx>
- Thread-index: AcdUvSdnjzYKMZqPS/2U9wq2gakAfg==
- Thread-topic: test if a parameter is numeric
> Sorry maybe I'm missing something, but if you need to match more than
> one digit, what's wrong with:
>
> [[ "$1" == [0-9][0-9]* ]]
Because it would also match "35X". Note that we have glob pattern here,
not regular expressions.
Ronald
--
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author