On Tue, 10 Sep 2002, Steven W. Orr wrote:

> tty_type=$(tty)
> if [[ ${tty_type%/*} = /dev/pts ]]
> then
>     TERM=vt100
> else
>     TERM=scoansi
> fi

Note that this will not catch instances inside of an xterm, since xterms 
are assigned on a pts and not a pty. You may also want to test $SHLVL to 
see if you're in a subshell. There may be other ways to do it, too, but 
this is the one I use:

    if [ $SHLVL -gt 1 ]; then
        # Your other if statements go here.
    fi

-- 
"The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing potatoes."

                        - Holly, JMC Vessel *Red Dwarf*



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to