#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo  --- license GNU GPL 

TTAHOME=/opt/taratella
STTATOOLS=$TTAHOME"/tools"
dn=/dev/null

[ "$STTA" ] && . $STTA/envprofile

if [ $1 ] ; then
   opc=""
   case $1 in
        -x|x) opc="-x" ; shift ;;
   esac
   cmd=$1
   shift 1
else
   cd $STTATOOLS 2>$dn
   echo "stta [ cmd  args] "
   echo "tools list ($STTATOOLS): "
   lista=`ls 2>$dn` 
   for file in ` echo $lista ` 
   do 
       [ ! -d $file ] && [ -x $file ] && echo  "$file"        
   done
   exit 1
fi 
if [ -x $STTATOOLS/$cmd ] 
then
   [ "$opc" ] && sh $opc $STTATOOLS/$cmd $@  && exit
   exec $STTATOOLS/$cmd $@ 
else
   echo "No puedo ejecutar $cmd $@"
fi


