#!/bin/sh
#linux sh-script for playing all .ted & .TED files in a directory with crted
#By Hermit (Mihaly Horvath) Year 2023

CTED_CMD=crteds

echo ""

if [ $# -eq 0 ] ; then
 echo "Play all .ted files in a folder, Usage: "
 echo " crteda [ skip_amount [crted-parameters] ]"
 echo "(Give '-' as skip_amount to start from beginning.)"
fi

STARTPOS=1
COUNTER=1

if [ "$1" != "-" ] && [ "$1" != "" ] ; then
 STARTPOS=$1
fi

for f in *.[Tt][Ee][Dd] *.[Tt][Mm][Ff] *.[Pp][Rr][Gg] ; do

 if [ $COUNTER -ge $STARTPOS ] ; then
  echo ; echo "Tune $COUNTER: $f"
  $CTED_CMD -autoexit "$2" "$3" "$4" "$5" "$6"  "$f"  1
 fi

 COUNTER=$((COUNTER + 1))
 #sleep 1

done


