Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Check for minimal ZSH version in shell script
- X-seq: zsh-users 23364
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: Re: Check for minimal ZSH version in shell script
- Date: Wed, 25 Apr 2018 11:29:54 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180425103001euoutp02c306f797b1deee6b6613d635d464019d~opxlT3cD42247822478euoutp02l
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1524652201; bh=k2+OT9n15maFDJHzjMiVe0Qn1a0ZUER9z5sLrW2IIYY=; h=Date:From:To:Subject:In-Reply-To:References:From; b=YTcFVVT4/tVCJkd1J8W2GhBpmIHt/jCAM80DQZSGIIfVPNWpvw9LFDGfMgS8Af4cC PqkA9VOwXOQGmxLUkvnt2U/4MxnJhS0xibla2qO1uwYqHZNBYuwatn3Hz0FGIJbBDj xq9PqmMLjAp3o1sHkDuZrpYEkRaLs9VfKFcDPkvQ=
- In-reply-to: <405bbbd4-c372-c15e-5cf6-b8025460e527@mscha.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180425101502epcas5p1fada2f6ce04b5f5be2d6abb54124d32f@epcas5p1.samsung.com> <405bbbd4-c372-c15e-5cf6-b8025460e527@mscha.com>
On Wed, 25 Apr 2018 12:04:45 +0200
Michael Schaap <zsh@xxxxxxxxx> wrote:
> Is there a good way to test for a minimal ZSH version in a shell
> script?
>
> I tried
> if [[ $ZSH_VERSION -ge 5.3]] then
> echo yes
> fi
> but that fails if the version has more than one decimal point (e.g.
> 5.5.1).
You should be able to do
autoload -Uz is-at-least
if is-at-least 5.3; then
...
fi
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author