From: Brice Goglin Date: Fri, 14 Jun 2013 09:44:33 +0000 (+0000) Subject: hwloc-gather-topology: check $# before using sh... X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=17ce953c33bef4e43ec1e4eb2aee5ef8a0e9469a;p=people%2Fandrewcoop%2Fhwloc.git hwloc-gather-topology: check $# before using sh... hwloc-gather-topology: check $# before using shift, some shells don't like shifting nothing This commit was SVN r5666. --- diff --git a/tests/linux/hwloc-gather-topology.in b/tests/linux/hwloc-gather-topology.in index 54f5295c..969eda78 100755 --- a/tests/linux/hwloc-gather-topology.in +++ b/tests/linux/hwloc-gather-topology.in @@ -34,6 +34,10 @@ usage() echo " $0 /tmp/\$(uname -n)" } +if test $# -lt 1 ; then + usage + exit 1 +fi name="$1"; shift if [ -z "$name" -o x`echo $name | cut -c1` = x- ] ; then [ x$name != x -a x$name != x-h -a x$name != x--help ] && echo "Unrecognized option: $name"