终端的标题并没有改变,可以说是没有任何效果。
然后我将
代码: 全选
echo -e "33]0;$107"
我去网上查寻相关资料,最后找到一句这样子的代码:
代码: 全选
export PROMPT_COMMAND='echo -ne "\033]0;qqq\007"'
我现在疑问就是这个例子其实本来就是运行看不到任何效果?
还是我哪里出问题了?
烦请指教阿,谢谢!
代码: 全选
#下面是一个名为xtitlebar的脚本,它可以改变终端窗口的名称。这里使用了一个名为help的函数,该函数在脚本中使用了两次:
#!/bin/sh
# vim: set sw=4 ts=4 et:
help()
{
cat << HELP
xtitlebar -- change the name of an xterm, gnome-terminal or kde konsole
USAGE: xtitlebar [-h] "string_for_titelbar"
OPTIONS: -h help text
EXAMPLE: xtitlebar "cvs"
HELP
exit 0
}
# in case of error or if -h is given we call the function help:
[ -z "$1" ] && help
[ "$1" = "-h" ] && help
# send the escape sequence to change the xterm titelbar:
echo -e "33]0;$107"
#