Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
possible 'is-at-least' bug?
- X-seq: zsh-users 21046
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: possible 'is-at-least' bug?
- Date: Fri, 4 Dec 2015 18:45:04 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=MkjgG3jnzU4+9d/g6jKOYVpmXuGl9ytJiPD9ChY/f/I=; b=Na7N5F9mL7puPFEQ90QQdz8F5eSSOSON9R7wPdQpC2bqpsxFTjovQ9dUs5Wj30j6Jd YZu3rZ2r3iHhqYSg4WadgvCDs5m8GzK2LAiEhUtB29MLeItUpGrZEmBHU24E8iwolVY4 ookeHOS78QKXdA07TyRB/lz2oep2cTm9Vq74jUG3SqVVWIZGxHobYgYcCZFOPFo4BHXk Z0/4l8NMatT2oktao0JhfPRWfQ0wPHgwc5zWYjmtOVQr0DMvGSyMYgrsE4ShAu1GVWFi V+UAPOTJqaExLfjdj9ACIXBwpRqN1P0I6WGTk7FozW+5v/2mu/Os/bA/NNsHf/ILqpTI IKcg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Thanks to a recent tip from the list, I've started using 'is-at-least' to
compare version numbers.
However, I seem to have found a situation/edge case where it does not seem
to work.
I am trying to compare version numbers of software, in this case ImageOptim
for the Mac.
The version I have installed is '1.6.1a1' where the 'a' is for 'alpha'
There is a newer version '1.6.1b2' where the 'b' is for 'beta'
##
LATEST_VERSION='1.6.1b2'
INSTALLED_VERSION='1.6.1a1'
autoload is-at-least
is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION"
if [ "$?" = "0" ]
then
echo "Up-To-Date (Installed = $INSTALLED_VERSION vs Latest =
$LATEST_VERSION)"
else
echo "Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)"
fi
exit 0
##
That test results in "Up-To-Date (Installed = 1.6.1a1 vs Latest = 1.6.1b2)"
TjL
Messages sorted by:
Reverse Date,
Date,
Thread,
Author