]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
hwloc-gather-topology: check $# before using sh...
authorBrice Goglin <brice.goglin@inria.fr>
Fri, 14 Jun 2013 09:44:33 +0000 (09:44 +0000)
committerBrice Goglin <brice.goglin@inria.fr>
Fri, 14 Jun 2013 09:44:33 +0000 (09:44 +0000)
hwloc-gather-topology: check $# before using shift, some shells don't like shifting nothing

This commit was SVN r5666.

tests/linux/hwloc-gather-topology.in

index 54f5295cbbbe815d296e26554eec32281c6e175e..969eda78ad9a59321e9db753149c5432ff916466 100755 (executable)
@@ -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"