Reputation: 51
i have some output in tcl which is printed using puts like this:
puts "hello world"
can we print the same in different color?
Upvotes: 1
Views: 6236
Reputation: 658
You need to use ANSI Escape sequences
For example, to print line in bold red color:
puts -nonewline "\033\[1;31m"; #RED
puts "My RED String"
puts -nonewline "\033\[0m";# Reset
Upvotes: 2