[LTP] [PATCH] containers/netns/netns_sysfs.sh: add kernel version check
Cyril Hrubis
chrubis@suse.cz
Tue Nov 1 15:30:31 CET 2016
Hi!
> If you're going to use letters for this, I suggest re-using what the
> 'test' a.k.a. '[' command has: -eq, -lt, -ge, -ne, etc.
>
> If multiple options (like in your example) are supported, re-using the
> logic from 'test' could also be a good idea: -a (and), -o (or), although
> shell-based && or || might be more obvious.
>
> if tst_kvercmp -ge "2.6.35" -a -lt "3.8"; then ...
>
> if tst_kvercmp -ge "2.6.35" && tst_kvercmp -lt "3.8"; then ...
FYI:
https://github.com/metan-ucw/ltp/commit/f18331dd1e2ff0772c71abf4c444de6487dbce87
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list