#! /bin/bash basename=`basename $0` termBin=Eterm defGeometry="80x50" function usage { cat < USAGE exit 1 } # arg parsing getoptResults=`getopt -o g:eh --long geometry,exit,help -n $basename -- "$@"` if [ $? != 0 ] ; then usage ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$getoptResults" while true ; do case "$1" in -g|--geometry) optGeometry="$2" ; shift 2 ;; -e|--exit) optExit=1 ; shift ;; -h|--help) optHelp=1 ; shift ;; --) shift ; break ;; *) echo "Internal error!" ; exit 1 ;; esac done # User asked for help if [ "$optHelp" = 1 ]; then usage ; fi # Create the xterm windows now optGeometry="-g ${optGeometry:-$defGeometry}" if [ $# -lt "1" ] then $termBin $baseParams & else for title in $* do params="$optGeometry -T $title -n $title" $termBin $params & done fi # Close parent term if user asked us to if [ "$optExit" = 1 ] then ppid=`ps -C te -o ppid=` kill -9 $ppid fi