How To
Summary
A simple utility to set the name of an xterm or a PuTTY session.
Objective
Environment
Steps
I have it in /usr/local/bin/xtitle on nearly all of my AIX and Linux systems.
It simply echoes the xterm ESCape sequence for setting the title of the xterm. It takes any arguments as a single string and makes them the title of the session.
Notice the use of $@ as opposed to $*
#!/bin/sh # Change title in an xterm window # modified by gaz to work on AIX or linux [ $(uname -s) = Linux ] && exec echo -e "\033]1;$@\007\033]2;$@\007\c" [ $(uname -s) = AIX ] && exec echo "\033]1;$@\007\033]2;$@\007\c"
I frequently use xtitle to set the window's title to the hostname and/or the UID, as above, or to set it to the task in hand, such as:
- xtitle NIM Master
- xtitle NIM Client
- xtitle MAN pages
- xtitle SCRIPTING
If you are unfamiliar with the difference between $* and $@ in the shell, see my blog entry on Special Parameters in the shell (eg: ksh, bash and sh)
Additional Information
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
03 May 2021
UID
ibm11116981