Thanks Shlomi.
Actually the 'tput' command mentioned in this article solved the problem for me :)
I guess for my humble shell script it's the best solution...


Thanks for all the info Guys.

Amit.

Shlomi Fish wrote:

There was a nice article on the subject in the Linux Gazette:

http://www.tldp.org/LDP/LG/issue65/padala.html

Regards,

Shlomi Fish

On Sun, 7 Sep 2003, Shachar Shemesh wrote:



Tal Peer wrote:



On Sun, 7 Sep 2003, Amit Roseberger wrote:





Hi List.
I have a script that produce output to the standard terminal (a shell
window in Linux).
For example:

[snip]

But... I want to understand exactly what happens and also to find out if
this is the best and most elegant solution.
I would appreciate a nice solution but also a direction to some written
man that describe it.
BAsically, I want to understand how this is done in the technical level
(I mean who is responsible the OS or the Shell) so that my code could be
run on different distributions of the same OS or different shells.





Well, the shell is responsible for output formatting, including
colours.



ahem noitisnt ahem



The bash way of colouring output (including colour codes) is
described in:
http://archives.real-time.com/pipermail/tclug-list/2002-March/048795.html




The colors are produced by the terminal emulation. In the case of a
virtual console, that is done by, I think, the kernel. In the case of X,
that is done by whatever program you opened (xterm, konsole, etc.).

The commands you describe above are the ANSI, or VT100, command set.
These were used by the traditional VT100 digital terminal, and are now
used by VT100 terminal emulators. There are, however, many other standards.

If you want your escape sequences to work on 90% of the cases, just use
the codes above. If you want them to work on 100% of the cases, RTFM
ncurses.

Shachar

--
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]






---------------------------------------------------------------------- Shlomi Fish [EMAIL PROTECTED] Home Page: http://t2.technion.ac.il/~shlomif/

There's no point in keeping an idea to yourself since there's a 10 to 1
chance that somebody already has it and will share it before you.






=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to