File ibmtss of Package ibmtss
#!/bin/bash
function usage() {
echo Usage: "$1" "<command>" "<arguments>"
echo -e "\thelp" "\t\tprint this help"
echo -e "\tlist" "\t\tlist commands"
echo -e "\t<command> -h" "\tdisplay command help"
}
function do_exec() {
self="$1"
shift
case "$1" in
help|""|*.*|*/*) usage "$self"
return 1
;;
list) find %UTILDIR% -maxdepth 1 -type f -a -executable -a -printf "%P\n" | grep -vF . | sort | tr '\n' ' '
echo
return 0
;;
*) if [ -x "%UTILDIR%/$1" ] ; then
%UTILDIR%/"$@"
return $?
else
echo Unknown command "$1"
return 1
fi
;;
esac
}
if [ "$#" -eq 0 ] ; then
while read -e -p "ibmtss> " -a line ; do
if [ "${#line[@]}" -gt 0 ] ; then
do_exec "" "${line[@]}"
fi
done
echo
else
do_exec $0 "$@"
exit $?
fi