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

STTA_TOOLSDIR="STTATOOLSDIR"
[ -x $STTA_TOOLSDIR/setenv_vars ] &&  . $STTA_TOOLSDIR/setenv_vars

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

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


