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

Re: test if a parameter is numeric



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