On Mon, Mar 20, 2006 at 09:07:29AM +0100, Wouter Verhelst wrote:
> On Sun, Mar 19, 2006 at 12:49:33PM -0500, Thomas Dickey wrote:
> > Stuff like this (in your .login) is already portable, works on every
> > unix platform.
> > 
> > #!/bin/sh
> > for name in foo bar xterm
> > do
> >         if ( tput -T$name am 2>/dev/null )
> >         then
> >                 echo ok $name
> >         fi
> > done
> 
> Yes; but if I then change my terminal (temporarily or permanently), it
> does break.

Certainly you can get around that.

if test "$TERM" = dtterm || "$TERM" = rxvt-unicode; then
  if ( tput -T$name am 2>/dev/null ); then
    :
  elif (tput -Txterm am 2>/dev/null ); then
    TERM=xterm
  fi
fi

And so on.

-- 
Daniel Jacobowitz
CodeSourcery


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to