#!/bin/bash HOST_NAME=`hostname -f` if [ `id -u` = 0 ]; then OPT=”`uname` (`uname -a | cut -f12 -d’ ‘ -`) - ROOT USER” else OPT=”`uname` (`uname -a | cut -f12 -d’ ‘ -`)” fi REPLACE=”${HOST_NAME} - ${OPT}” echo -n -e “\033]0; $REPLACE \007 “ echo “${REPLACE}” exit 0
Then run this script, and your termtitle will be something like the following:
Servername (Linux / x86_64).
For Solaris it needs to be done a bit differently:
#!/usr/local/bin/bash HOST_NAME=`uname -a | cut -f2 -d’ ‘ -` OPT=”(`uname -a | cut -f1 -d’ ‘ -` / `uname -a | cut -f6 -d’ ‘`)” REPLACE=”${HOST_NAME} - ${OPT}” echo -n -e “\033]0; $REPLACE \007 “ echo “${REPLACE}” exit 0
Add/remove things from the OPT= line to customize. To test it, just issue the command on the commandline without the ()'s to see what it'll look like.