Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: test if a parameter is numeric
- X-seq: zsh-users 11208
- From: <zsh@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: test if a parameter is numeric
- Date: Tue, 20 Feb 2007 03:56:56 +0000
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=Hl3JQJKt1BGRqpwv49erVg2YG2omWNZ9lD5MZosUs0RNkOpCFUVTJOSyBBx/UEurKWU2j41ZB+R66IHeUatZyvUAl5MjYFKtmJv1kv5ZyqNoi65RsEV77zcmKEzNMAVHz+ymDNKayf6U/W84/GKEKwYQrJyDh8ohKYqavHrnc7A=
- In-reply-to: <E1HJLZy-0001UA-44@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns98D2ADD16C100zzappergmailcom@xxxxxxxxxxx> <070209182939.ZM18654@xxxxxxxxxxxxxxxxxxxxxx> <003d01c74d3f$3bbd7960$6600000a@venti> <E1HG3Bl-0007Ge-DM@xxxxxxxxxx> <E1HJIfJ-0002Ok-Ql@xxxxxxxxxx> <E1HJLZy-0001UA-44@xxxxxxxxxxxx>
On Mon, Feb 19, 2007 at 09:21:38PM -0600, Andrew Ruder wrote:
> There is a ZSH extension that would have more of the effect you are
> looking for but its as unportable as most other solutions,
> unfortunately.
Ah, okay. What I was thinking of is a bashism anyway:
[[ "$1" =~ [0-9][0-9]*$ ]]
I forgot it should be =~, and the $ will prevent it from matching your
other examples. But this seems to mean something else in zsh.
Lydgate
Messages sorted by:
Reverse Date,
Date,
Thread,
Author