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

Re: Check for minimal ZSH version in shell script



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