09-13-2010
Text file colors
Hi everyone.
I want to create a text file using different colors, but i dont know how to do that.
I just can set the color for the -screen- output, using. for example:
printf "\033[32m"
printf "%-20s\n" "Orange colour"
printf "\033[mo"
but if i redirect the second line output to a text file, it doestn do it with colours...
does anybody now how to do that ?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is it possible to change the color of text in a korn shell script Menu?
I can change the color of session text through my telnet client but I want to be able to change color text in the Korn shell menu to highlight certain items. (6 Replies)
Discussion started by: darthur
6 Replies
2. UNIX Desktop Questions & Answers
Hello, I am somewhat new to linux. I just installed Red Hat 7.2 and when I try to load gnome or KDE in colors above 8bit it will kind of lock up and display some wierd scrambled cable look. I have an ATI Radeon 7000. I check out my monitor settings they are fine. Is it the graphics card? I set my... (1 Reply)
Discussion started by: Sage3k
1 Replies
3. UNIX for Dummies Questions & Answers
Is there a way with the bourne shell to have different types of files show up a different color when you do ls? (1 Reply)
Discussion started by: resullivan
1 Replies
4. Shell Programming and Scripting
Hi All,
I need to BCP out a table into a text file along with the table headers. Normal BCP out command only bulk copies the data, and not the headers.
I am using the following command: bcp database1..table1 out file1.dat -c -t\| -b1000 -A8192 -Uuser -Ppassword -efile.dat.err
Regards,... (0 Replies)
Discussion started by: shilpa_acc
0 Replies
5. Shell Programming and Scripting
Hi
I need to create multiple text files from onc text file on AIX. The data of text files is as below:
**********************************************
**********************************************
DBVERIFY: Release 10.2.0.4.0 - Production on Tue Nov 10 13:45:42 2009
Copyright (c) 1982,... (11 Replies)
Discussion started by: lodhi1978
11 Replies
6. UNIX for Dummies Questions & Answers
I have a text file with irregular spacing between values which makes it really difficult to manipulate. Is there an easy way to convert it into a space delimited text file so that all the spaces, double spaces, triple spaces, tabs between numbers are converted into spaces. The file looks like this:... (5 Replies)
Discussion started by: evelibertine
5 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
8. Shell Programming and Scripting
Hi,
I'm trying to send a log file to mailx as a "Body Message" but since the file contains so many control and color characters it's making an attachement out of it instead of putting it in the body.
The file looks like this:
Bringing up loopback interface: ^^M^MŽ
19 Bringing up interface... (18 Replies)
Discussion started by: dgtek
18 Replies
9. Shell Programming and Scripting
HI
i am running a shell script in cron and storing the output of that script in a file say test.then i am copying the content of test to test1 and i will send the output of test to some email ids using mutt. Next time when the script executes i am comparing the contents of test and test1 and... (3 Replies)
Discussion started by: venkitesh
3 Replies
10. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT CENTOS
sdl_setcolors
SDL_SetColors(3) SDL API Reference SDL_SetColors(3)
NAME
SDL_SetColors - Sets a portion of the colormap for the given 8-bit surface.
SYNOPSIS
#include "SDL.h"
int SDL_SetColors(SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);
DESCRIPTION
Sets a portion of the colormap for the given 8-bit surface.
When surface is the surface associated with the current display, the display colormap will be updated with the requested colors. If
SDL_HWPALETTE was set in SDL_SetVideoMode flags, SDL_SetColors will always return 1, and the palette is guaranteed to be set the way you
desire, even if the window colormap has to be warped or run under emulation.
The color components of a SDL_Color structure are 8-bits in size, giving you a total of 256^3 =16777216 colors.
Palettized (8-bit) screen surfaces with the SDL_HWPALETTE flag have two palettes, a logical palette that is used for mapping blits to/from
the surface and a physical palette (that determines how the hardware will map the colors to the display). SDL_SetColors modifies both pal-
ettes (if present), and is equivalent to calling SDL_SetPalette with the flags set to (SDL_LOGPAL | SDL_PHYSPAL).
RETURN VALUE
If surface is not a palettized surface, this function does nothing, returning 0. If all of the colors were set as passed to SDL_SetColors,
it will return 1. If not all the color entries were set exactly as given, it will return 0, and you should look at the surface palette to
determine the actual color palette.
EXAMPLE
/* Create a display surface with a grayscale palette */
SDL_Surface *screen;
SDL_Color colors[256];
int i;
.
.
.
/* Fill colors with color information */
for(i=0;i<256;i++){
colors[i].r=i;
colors[i].g=i;
colors[i].b=i;
}
/* Create display */
screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
if(!screen){
printf("Couldn't set video mode: %s
", SDL_GetError());
exit(-1);
}
/* Set palette */
SDL_SetColors(screen, colors, 0, 256);
.
.
.
.
SEE ALSO
SDL_Color SDL_Surface, SDL_SetPalette, SDL_SetVideoMode
SDL
Tue 11 Sep 2001, 23:01 SDL_SetColors(3)