Chinaunix首页 | 论坛 | 博客
  • 博客访问: 222728
  • 博文数量: 48
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 412
  • 用 户 组: 普通用户
  • 注册时间: 2013-04-24 10:27
个人简介

Continuous pursuit technical details

文章分类

全部博文(48)

文章存档

2014年(1)

2013年(47)

分类: LINUX

2013-12-09 11:25:07

#!/bin/ksh


export TERMINFO=$HOME/lib/terminfo


#------------------------------------------------------------------------#
# Setting up TERM type by prompting at login                             #
#------------------------------------------------------------------------#
#term_def=xterm
term_def=dtterm
term_string=`echo $term_def |  awk '{ b = length($1); printf("%s", $1); for( i =0; i < b; i++) { printf("\b") } } '`


read TERM?"TERM = ${term_string}"
TERM=${TERM:-$term_def}


#------------------------------------------------------------------------#
# set title
#------------------------------------------------------------------------#
tit_def="$GENERIC $tit_def"
read Sel_title?"Set title (default ${tit_def}): "
Sel_title=${Sel_title:-$tit_def}


case "$TERM" in
sun-cmd|sun)
        echo "\033]l${Sel_title}^[\\";;
vt100|xterm|dtterm)
        echo "\033]0;${Sel_title}^G\c";;
730)
        echo "\033[?${#1};1v$Sel_title";;
*)
        echo "Don't recognize TERM type";;
esac

阅读(1624) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~