#!/bin/sh
#
# --- UCSF Chimera Copyright ---
# Copyright (c) 2000-2003 Regents of the University of California.
# All rights reserved.  This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use.  This notice must be embedded in or
# attached to all copies, including partial copies, of the
# software or any revisions or derivations thereof.
# --- UCSF Chimera Copyright ---
#
# $Id: chimera_send 26655 2009-01-07 22:02:30Z gregc $

# set path so we get the versions of command we expect
originalpath="$PATH"
PATH=/bin:/usr/bin:"$PATH"

# application name can be hardcoded by altering the next line
app=`basename "$0"`

# canonicalize CHIMERA for consistency with Tcl/Tk
if test "$CHIMERA"
then
	CHIMERA=`cd "$CHIMERA"; pwd -P`
else
	# Assume we were started as CHIMERA/bin/$app and
	# deduce what CHIMERA should be.  Try to work when
	# application is linked to with a symbolic link
	tmp=`ls -l "$0"`
	CHIMERA=`echo "$tmp" | sed 's/.* -> //'`
	if test "$tmp" = "$CHIMERA"
	then
		CHIMERA="$0"
	fi
	CHIMERA=`dirname "$CHIMERA"`
	CHIMERA=`cd "$CHIMERA"; pwd -P`
	CHIMERA=`dirname "$CHIMERA"`
fi
#export CHIMERA
#echo $CHIMERA

if test $# -gt 0
then
	$CHIMERA/bin/chimera --send $@
else
	$CHIMERA/bin/chimera
fi
