[download]

local/bin/term

   1 #!/bin/bash
   2 
   3 term(){
   4     local t=${1%% *}
   5     xterm -e $SHELL -ic "printf \"\e]0;${t^}\a\"; $@" ||
   6     xterm -x $SHELL -ic "printf \"\e]0;${t^}\a\"; $@" &
   7 }
   8 
   9 case $1 in
  10     -*) term "${*:2}";;
  11      *) term "$*"    ;;
  12 esac