6 ttyprefix=/dev/; #for linux systems with /dev/pts
7 cmdcolumn=5 ;# where to find command in ps output
8 ttycolumn=2 ;# where to find tty name in ps output
10 get_tty_from_command () {
12 t=`ps $psargs|awk "\\$$cmdcolumn~/$1/ {print \"$ttyprefix\" \\$$ttycolumn;exit}"`
23 echo "$i is not valid tty name" >&2
28 echo "$i is not writable for you" >&2
34 if get_tty_from_command $COMMAND; then
35 echo -n '
\e[1t
\e[5t' >$tty
37 xterm -T "$TITLE" -name $COMMAND -e "$@" &