Skip to content

[Feature Request]: basic/ck_version: check if version_1 is not less than version_2 #85

Description

@aronchanisme

Is there an existing issue for the feature request?

  • I have checked the existing issues.

Feature Description

basic/ck_version: check if version_1 is not less than version_2

usage: 
check/ck_version.sh <version_1> <version_2>, where,
version_1: e.g. 3.10.0
version_1: e.g. 3.11.0

example:
check/ck_kernel_version.sh 3.10.0 3.11.0  # return 1
check/ck_kernel_version.sh 3.11.0 3.10.0 # return 0
check/ck_kernel_version.sh 3.11.0 3.11.0 # return 0


output:
return 0: if yes
return 1: otherwise

Feature Implementation

rc=$(awk -v  v1=$version_1 -v v2=$version_2  'BEGIN{print(v1>=v2)?"0":"1"}')

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions