From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Hrubis Date: Tue, 1 Nov 2016 15:30:31 +0100 Subject: [LTP] [PATCH] containers/netns/netns_sysfs.sh: add kernel version check In-Reply-To: References: <1472544117-7584-1-git-send-email-fenggw-fnst@cn.fujitsu.com> <20161031092825.GB30590@rei.lan> Message-ID: <20161101143031.GA19327@rei.lan> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it 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