#!/bin/sh LIBDIR=/usr/share/kernel-wedge/commands usage () { echo "Usage: kernel-wedge command options" echo "Commands:" for file in $LIBDIR/*; do printf " %s\n" "${file##*/}" done exit 1 } set -e command=$1 if [ -z "$command" ]; then usage fi if [ ! -x "$LIBDIR/$command" ]; then usage fi shift 1 || true $LIBDIR/$command "$@"