[LTP] [PATCH] containers/netns/netns_sysfs.sh: add kernel version check
Cyril Hrubis
chrubis@suse.cz
Mon Oct 31 15:36:45 CET 2016
Hi!
> > where the modifiers would stand for:
> >
> > n newer
> > nq newer or equal
> > o older
> > oq older or equal
>
> 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 ...
Sounds good. I will look into this.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list