Solved

Coloring AIX console

Posted on 2014-09-11
6
740 Views
Last Modified: 2014-09-30
I am planning to color up my text and background on a AIX console and would like to permanently add it to my .profile in the home directory.

I have searched some post on EE, I found a solution and I was trying to implement #25899388/#25920311 but for some reason its not working. I have both ksh versions. But for now I am using KSH

To color the text yellow, I tried ..

color=$(tput colf3); nocolor=$(tput sgr 0); export PS1='${color}[$PWD]>${nocolor}'

1. Can you please help if I need to do something else.
2. I would also like to know how to change the background color also..

Thank you
0
Comment
Question by:Ramu Shetty
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:carlmd
ID: 40319659
Do you really mean the system console or just your device?

Is you console configured as CDE?
0
 

Author Comment

by:Ramu Shetty
ID: 40319785
When I say Console, Its the putty session I am using to connect to an AIX server.
0
 
LVL 20

Expert Comment

by:carlmd
ID: 40322784
The tput sequences you define are dependent upon what is defined in the tic file for the terminal type you have set for your session.

From your putty session please type:

echo $TERM

and post the result.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:Ramu Shetty
ID: 40323413
Here are the results

$ echo $TERM
vt100

So can you please let me know where should i update the tic file and what should i update with..??
0
 
LVL 20

Accepted Solution

by:
carlmd earned 500 total points
ID: 40325195
The tic files are located In /usr/lib/terminfo. Their are two parts, a source version and a compiled version.

For a vt100 you "might" have the source in the above directory as vt100, but more likely under the name dec.ti. Note that  the compiled versions are in the sub directory "v". You won't be touching those directly.

Assuming you have the dec.ti, it is a text file that you can edit with vi or any other editor you use. I suggest you make a backup copy of this file before you do anything to it. Alternately, create a new terminal type (say vt100me) in a new file by that name, then extract what you need and put it in that file.

The programming in these files is a language into itself. For info on that look at:

http://tldp.org/HOWTO/Text-Terminal-HOWTO-16.html
http://www.delorie.com/gnu/docs/termcap/termcap_toc.html

To get you started, edit the dec.ti file and you will find numerous comments and variations of the vt100 definition. You should first read through these to see if one of them will already do what you want. Typically a vt100 does not have color, so you might want to look at a vt200 and above for examples of color settings. For example the vt240 for background colors.

If you start by making your own terminal type instead of editing the dec.ti, then you can work on this without worrying about it causing problems for anyone else on your system using a vt100 terminal type.

Once you have created your new file (or edited the dec.ti), you will need to compile it before you can use it. To do this you simply type "tic vt100me". This will now produce a new terminal type for you to use. To test with this, after you login with putty you can type at the command prompt "TERM=vt100me" and you will them be using your file.

Please not that I suggest you put everything you need/want in the new tic file so that you avoid having to type tput sequences.

Hope this helps. Let me know if you have questions.
0
 
LVL 9

Expert Comment

by:Carlos Ijalba
ID: 40345591
Sriveena,

"When I say Console, Its the putty session I am using to connect to an AIX server."

What you really want to do is just chage the colors in your PuTTY session definition, and that way you can define different sessions to the same server, but using different color schemes, ie: you can have one to read logs, another to program scripts, etc.

This is done from within PuTTY itself:

Select your saved session name from the Saved Sessions left pane and click Load,
expand the Window entry on the left and select  Colours
now you can change the Default Foreground, and Default Background, for example to create a "whitepaper" feel try Foreground 0 (black) and Background 255 (white)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now