#!/bin/sh
# $Id: emulatorsession_shadow,v 1.4 2015-03-31 12:24:22 pc161604 Exp $
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
#
args="$@"
while [ $# -gt 0 ]
do
  case "$1" in
     --help)
      $TTABINDIR/tarantella print_emulatorsession shadow --help
      exit 0
    ;;
  esac
  shift
done

full_output=`$TTABINDIR/scripts/prepare_tclscript print_emulatorsession print_emulatorsession_shadow $args`
RES=$?
single_line=`echo $full_output | tail -1`
bin_name=`expr "$single_line" : '\([^ ]*\).*$'`
if [ -x "$bin_name" ]; then
  eval $single_line
else
  echo $single_line
fi 

exit $RES

