IBM Support

xtitle - set the name of an xterm (also a PuTTY session)

How To


Summary

A simple utility to set the name of an xterm or a PuTTY session.

Objective

Banner_AIX_i_Linux
This makes life easier if you have several sessions running on different systems.

Environment

You can use this command in an xterm or a PuTTY session. It takes immediate effect.

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"
Here is an example:

image-20191128084046-1

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

You can contact me: 

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"HW1A1","label":"IBM Power Systems"},"Component":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF050","label":"BMC"},{"code":"PF041","label":"HMC"},{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
03 May 2021

UID

ibm11116981