#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2003 Jesús Pérez Lorenzo  --- license GNU GPL 
# stta: (@#) 1.3pre1049295437- [2003_4_02_165717]

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


