29 липня 2005 о 19:40 -0400 Joey Hess написав(-ла):
> 
> Any idea of a good way to check for this? Note that it would need to
> work using only the packages in base.
> 

This should work (tput is from ncurses-bin):

if tput init > /dev/null 2>&1; then
 echo "Run dialog frontend"
else
 echo "Run teletype frontend"
fi

Examples:

$ TERM=linux tput init > /dev/null 2>&1; echo $?
0
$ TERM=cvgfdvfdbrt tput init > /dev/null 2>&1; echo $?
3

-- 
Eugeniy Meshcheryakov

Kyiv National Taras Shevchenko University
Information and Computing Centre
http://icc.univ.kiev.ua

Attachment: signature.asc
Description: Digital signature

Reply via email to