#!/bin/sh
# $FreeBSD: ports/lang/tcl-tk-wrapper/files/tclsh.in,v 1.1 2007/03/06 19:38:10 miwi Exp $
#
# Wrapper for the tcl shell "tclsh"

TCLSH=
TCLTK_CONF=/usr/local/etc/tcltk.conf

if [ -f "${TCLTK_CONF}" ]; then
  . ${TCLTK_CONF}
  if [ -n "${TCLSH}" ]; then
    if [ -x "${TCLSH}" ]; then
      exec ${TCLSH} "$@"
    else
      echo "File not found or not executable: ${TCLSH}" 
      echo "Please check variable TCLSH in: ${TCLTK_CONF}"
    fi
  else
    echo "You do not have set path to default tclsh in the configuration file:"
    echo "/usr/local/etc/tcltk.conf"
    echo "Please see the sample configuration file for details:"
    echo "/usr/local/etc/tcltk.conf.sample"
  fi
  echo ""
  echo "You may need a tcl shell installed to use this wrapper from ports like:"
  echo "lang/tcl84 or lang/tcl85"
else
  echo "Configuration file not found: /usr/local/etc/tcltk.conf"
  echo "Please see the sample configuration file for details:"
  echo "/usr/local/etc/tcltk.conf.sample"
fi
