<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: set Window title using a script (gnome-terminal/RedHat AS4) in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012635#M65058</link>
    <description>&lt;!--!*#--&gt;Use echo -e instead of print to work with bash.&lt;BR /&gt;The bash echo command can use either "\c" or -n to suppress a newline.&lt;BR /&gt;You need to use &amp;gt;&amp;amp;2 instead of -u2 to send echo to stderr.&lt;BR /&gt;Your xterm escape sequence should end the title string with "\007".&lt;BR /&gt;You can set just the window title in gnome-terminal with "\033]2;$*\007"&lt;BR /&gt;&lt;BR /&gt;$ diff -u title.orig  title&lt;BR /&gt;--- title.orig  2006-11-09 14:24:56.000000000 -0700&lt;BR /&gt;+++ title       2006-11-10 09:17:30.000000000 -0700&lt;BR /&gt;@@ -13,7 +13,7 @@&lt;BR /&gt; xterm*) window_type=x;;&lt;BR /&gt; hp*|26*|23*) window_type=hp;;&lt;BR /&gt; dtterm) window_type=dt;;&lt;BR /&gt;-*) print -u2 "$0: What kind of TERM is $TERM\?"&lt;BR /&gt;+*) echo "$0: What kind of TERM is $TERM\?" &amp;gt;&amp;amp;2&lt;BR /&gt; return 1;;&lt;BR /&gt; esac&lt;BR /&gt;&lt;BR /&gt;@@ -31,13 +31,13 @@&lt;BR /&gt; function set_title # set title bar only&lt;BR /&gt; {&lt;BR /&gt; case $1 in&lt;BR /&gt;-x) shift; print '\033]0;'"${*}"'\c' # title bar only&lt;BR /&gt;+x) shift; echo -e '\033]2;'"${*}"'\007\c' # title bar only&lt;BR /&gt; # In xterm, '\033]0;'"${*}"'\033\c' sets icon AND title bar&lt;BR /&gt; ;;&lt;BR /&gt;-dt) shift; print '\033]0;'"${*}" # title bar only&lt;BR /&gt;+dt) shift; echo -e '\033]0;'"${*}" # title bar only&lt;BR /&gt; ;;&lt;BR /&gt; hp) shift; title="$@"&lt;BR /&gt;-print '\033&amp;amp;f0k'${#title}D"$title"\\c&lt;BR /&gt;+echo -e '\033&amp;amp;f0k'${#title}D"$title"\\c&lt;BR /&gt; ;;&lt;BR /&gt; esac&lt;BR /&gt; }&lt;BR /&gt;@@ -45,21 +45,21 @@&lt;BR /&gt; function set_icon # set icon label only&lt;BR /&gt; {&lt;BR /&gt; case $1 in&lt;BR /&gt;-x) shift; print '\033]1;'"${*}"'\033\c'&lt;BR /&gt;+x) shift; echo -e '\033]1;'"${*}"'\007\c'&lt;BR /&gt; ;;&lt;BR /&gt;-dt) shift; print '\033]1;'"${*}"&lt;BR /&gt;+dt) shift; echo -e '\033]1;'"${*}"&lt;BR /&gt; ;;&lt;BR /&gt; hp) shift; title="${*}"&lt;BR /&gt;-print '\033&amp;amp;f-1k'${#title}D"$title"\\c&lt;BR /&gt;+echo -e '\033&amp;amp;f-1k'${#title}D"$title"\\c&lt;BR /&gt; ;;&lt;BR /&gt; esac&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; # If there were no arguments, print a usage synopsis&lt;BR /&gt; if [ $# = 0 ]&lt;BR /&gt;-then print -u2 "Usage: ${0##*/} Your Title Here"&lt;BR /&gt;-print -u2 "or: ${0##*/} -i Icon Title Only"&lt;BR /&gt;-print -u2 "or: ${0##*/} -w Window Title Only"&lt;BR /&gt;+then echo "Usage: ${0##*/} Your Title Here" &amp;gt;&amp;amp;2&lt;BR /&gt;+echo "or: ${0##*/} -i Icon Title Only" &amp;gt;&amp;amp;2&lt;BR /&gt;+echo "or: ${0##*/} -w Window Title Only" &amp;gt;&amp;amp;2&lt;BR /&gt; exit 1&lt;BR /&gt; else&lt;BR /&gt; Main "$@"&lt;BR /&gt;</description>
    <pubDate>Fri, 10 Nov 2006 11:35:00 GMT</pubDate>
    <dc:creator>Mike Stroyan</dc:creator>
    <dc:date>2006-11-10T11:35:00Z</dc:date>
    <item>
      <title>set Window title using a script (gnome-terminal/RedHat AS4)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012634#M65057</link>
      <description>Hi folks,&lt;BR /&gt;&lt;BR /&gt;I have been using a script for about 14 years on HP-UX to set window titles.&lt;BR /&gt;&lt;BR /&gt;Now I switched to Linux. gnome-terminal sets TERM to xterm, so I'm trying to use my script to set the window (tab) title. But bash seems not to know the "print" command (see script below).&lt;BR /&gt;&lt;BR /&gt;What do I use instead of the "print" command/builtin?&lt;BR /&gt;&lt;BR /&gt;Helpful answers will be rewarded with points of course.&lt;BR /&gt;&lt;BR /&gt;Thanks, Christian&lt;BR /&gt;&lt;BR /&gt;#! /bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Set the title bar and perhaps the icon for a window&lt;BR /&gt;# Usage:  title Your Title Here&lt;BR /&gt;#         title -i Icon Only&lt;BR /&gt;#         title -w Window Only&lt;BR /&gt;&lt;BR /&gt;function Main&lt;BR /&gt;{&lt;BR /&gt;        # Decide on the type of terminal window they are using&lt;BR /&gt;        # so we can emit the correct escape sequences.&lt;BR /&gt;        case $TERM in&lt;BR /&gt;        xterm*)         window_type=x;;&lt;BR /&gt;        hp*|26*|23*)    window_type=hp;;&lt;BR /&gt;        dtterm)         window_type=dt;;&lt;BR /&gt;        *)              print -u2 "$0:  What kind of TERM is $TERM\?"&lt;BR /&gt;                        return 1;;&lt;BR /&gt;        esac&lt;BR /&gt;&lt;BR /&gt;        # Call the function to set both the title and icon or just the&lt;BR /&gt;        # icon, depending on if they used the -i flag.&lt;BR /&gt;        case "$1" in&lt;BR /&gt;        -i)     shift; set_icon $window_type "$@";;&lt;BR /&gt;        -w)     shift; set_title $window_type "$@";;&lt;BR /&gt;        *)      set_title $window_type "$@";&lt;BR /&gt;                set_icon $window_type "$@";;&lt;BR /&gt;vi -c 1 /home/cdeutsch/bin/title------------------------&lt;BR /&gt;[cdeutsch@hesed tmp]$ wcl ~/bin/title&lt;BR /&gt;bash: wcl: command not found&lt;BR /&gt;[cdeutsch@hesed tmp]$ wc -l ~/bin/title&lt;BR /&gt;67 /home/cdeutsch/bin/title&lt;BR /&gt;[cdeutsch@hesed tmp]$ cat ~/bin/title&lt;BR /&gt;#! /bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Set the title bar and perhaps the icon for a window&lt;BR /&gt;# Usage:  title Your Title Here&lt;BR /&gt;#         title -i Icon Only&lt;BR /&gt;#         title -w Window Only&lt;BR /&gt;&lt;BR /&gt;function Main&lt;BR /&gt;{&lt;BR /&gt;        # Decide on the type of terminal window they are using&lt;BR /&gt;        # so we can emit the correct escape sequences.&lt;BR /&gt;        case $TERM in&lt;BR /&gt;        xterm*)         window_type=x;;&lt;BR /&gt;        hp*|26*|23*)    window_type=hp;;&lt;BR /&gt;        dtterm)         window_type=dt;;&lt;BR /&gt;        *)              print -u2 "$0:  What kind of TERM is $TERM\?"&lt;BR /&gt;                        return 1;;&lt;BR /&gt;        esac&lt;BR /&gt;&lt;BR /&gt;        # Call the function to set both the title and icon or just the&lt;BR /&gt;        # icon, depending on if they used the -i flag.&lt;BR /&gt;        case "$1" in&lt;BR /&gt;        -i)     shift; set_icon $window_type "$@";;&lt;BR /&gt;        -w)     shift; set_title $window_type "$@";;&lt;BR /&gt;        *)      set_title $window_type "$@";&lt;BR /&gt;                set_icon $window_type "$@";;&lt;BR /&gt;        esac&lt;BR /&gt;        return 0&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function set_title      # set title bar only&lt;BR /&gt;{&lt;BR /&gt;        case $1 in&lt;BR /&gt;        x)   shift; print '\033]0;'"${*}"'\c'   # title bar only&lt;BR /&gt;             # In xterm, '\033]0;'"${*}"'\033\c' sets icon AND title bar&lt;BR /&gt;             ;;&lt;BR /&gt;        dt)  shift; print '\033]0;'"${*}"       # title bar only&lt;BR /&gt;             ;;&lt;BR /&gt;        hp)  shift; title="$@"&lt;BR /&gt;             print '\033&amp;amp;f0k'${#title}D"$title"\\c&lt;BR /&gt;             ;;&lt;BR /&gt;        esac&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function set_icon       # set icon label only&lt;BR /&gt;{&lt;BR /&gt;        case $1 in&lt;BR /&gt;        x)   shift; print '\033]1;'"${*}"'\033\c'&lt;BR /&gt;             ;;&lt;BR /&gt;        dt)  shift; print '\033]1;'"${*}"&lt;BR /&gt;             ;;&lt;BR /&gt;        hp)  shift; title="${*}"&lt;BR /&gt;             print '\033&amp;amp;f-1k'${#title}D"$title"\\c&lt;BR /&gt;             ;;&lt;BR /&gt;        esac&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;# If there were no arguments, print a usage synopsis&lt;BR /&gt;if [ $# = 0 ]&lt;BR /&gt;then    print -u2 "Usage: ${0##*/} Your Title Here"&lt;BR /&gt;        print -u2 "or:    ${0##*/} -i Icon Title Only"&lt;BR /&gt;        print -u2 "or:    ${0##*/} -w Window Title Only"&lt;BR /&gt;        exit 1&lt;BR /&gt;else&lt;BR /&gt;        Main "$@"&lt;BR /&gt;        exit $?&lt;BR /&gt;fi</description>
      <pubDate>Tue, 07 Nov 2006 09:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012634#M65057</guid>
      <dc:creator>Christian Deutsch_1</dc:creator>
      <dc:date>2006-11-07T09:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: set Window title using a script (gnome-terminal/RedHat AS4)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012635#M65058</link>
      <description>&lt;!--!*#--&gt;Use echo -e instead of print to work with bash.&lt;BR /&gt;The bash echo command can use either "\c" or -n to suppress a newline.&lt;BR /&gt;You need to use &amp;gt;&amp;amp;2 instead of -u2 to send echo to stderr.&lt;BR /&gt;Your xterm escape sequence should end the title string with "\007".&lt;BR /&gt;You can set just the window title in gnome-terminal with "\033]2;$*\007"&lt;BR /&gt;&lt;BR /&gt;$ diff -u title.orig  title&lt;BR /&gt;--- title.orig  2006-11-09 14:24:56.000000000 -0700&lt;BR /&gt;+++ title       2006-11-10 09:17:30.000000000 -0700&lt;BR /&gt;@@ -13,7 +13,7 @@&lt;BR /&gt; xterm*) window_type=x;;&lt;BR /&gt; hp*|26*|23*) window_type=hp;;&lt;BR /&gt; dtterm) window_type=dt;;&lt;BR /&gt;-*) print -u2 "$0: What kind of TERM is $TERM\?"&lt;BR /&gt;+*) echo "$0: What kind of TERM is $TERM\?" &amp;gt;&amp;amp;2&lt;BR /&gt; return 1;;&lt;BR /&gt; esac&lt;BR /&gt;&lt;BR /&gt;@@ -31,13 +31,13 @@&lt;BR /&gt; function set_title # set title bar only&lt;BR /&gt; {&lt;BR /&gt; case $1 in&lt;BR /&gt;-x) shift; print '\033]0;'"${*}"'\c' # title bar only&lt;BR /&gt;+x) shift; echo -e '\033]2;'"${*}"'\007\c' # title bar only&lt;BR /&gt; # In xterm, '\033]0;'"${*}"'\033\c' sets icon AND title bar&lt;BR /&gt; ;;&lt;BR /&gt;-dt) shift; print '\033]0;'"${*}" # title bar only&lt;BR /&gt;+dt) shift; echo -e '\033]0;'"${*}" # title bar only&lt;BR /&gt; ;;&lt;BR /&gt; hp) shift; title="$@"&lt;BR /&gt;-print '\033&amp;amp;f0k'${#title}D"$title"\\c&lt;BR /&gt;+echo -e '\033&amp;amp;f0k'${#title}D"$title"\\c&lt;BR /&gt; ;;&lt;BR /&gt; esac&lt;BR /&gt; }&lt;BR /&gt;@@ -45,21 +45,21 @@&lt;BR /&gt; function set_icon # set icon label only&lt;BR /&gt; {&lt;BR /&gt; case $1 in&lt;BR /&gt;-x) shift; print '\033]1;'"${*}"'\033\c'&lt;BR /&gt;+x) shift; echo -e '\033]1;'"${*}"'\007\c'&lt;BR /&gt; ;;&lt;BR /&gt;-dt) shift; print '\033]1;'"${*}"&lt;BR /&gt;+dt) shift; echo -e '\033]1;'"${*}"&lt;BR /&gt; ;;&lt;BR /&gt; hp) shift; title="${*}"&lt;BR /&gt;-print '\033&amp;amp;f-1k'${#title}D"$title"\\c&lt;BR /&gt;+echo -e '\033&amp;amp;f-1k'${#title}D"$title"\\c&lt;BR /&gt; ;;&lt;BR /&gt; esac&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; # If there were no arguments, print a usage synopsis&lt;BR /&gt; if [ $# = 0 ]&lt;BR /&gt;-then print -u2 "Usage: ${0##*/} Your Title Here"&lt;BR /&gt;-print -u2 "or: ${0##*/} -i Icon Title Only"&lt;BR /&gt;-print -u2 "or: ${0##*/} -w Window Title Only"&lt;BR /&gt;+then echo "Usage: ${0##*/} Your Title Here" &amp;gt;&amp;amp;2&lt;BR /&gt;+echo "or: ${0##*/} -i Icon Title Only" &amp;gt;&amp;amp;2&lt;BR /&gt;+echo "or: ${0##*/} -w Window Title Only" &amp;gt;&amp;amp;2&lt;BR /&gt; exit 1&lt;BR /&gt; else&lt;BR /&gt; Main "$@"&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Nov 2006 11:35:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012635#M65058</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2006-11-10T11:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: set Window title using a script (gnome-terminal/RedHat AS4)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012636#M65059</link>
      <description>Perfect! Thank you Mike!</description>
      <pubDate>Mon, 13 Nov 2006 08:36:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/set-window-title-using-a-script-gnome-terminal-redhat-as4/m-p/5012636#M65059</guid>
      <dc:creator>Christian Deutsch_1</dc:creator>
      <dc:date>2006-11-13T08:36:40Z</dc:date>
    </item>
  </channel>
</rss>

