Sponsored Content
Top Forums Shell Programming and Scripting Change color or font when executing a script Post 302507465 by lhareigh890 on Thursday 24th of March 2011 01:21:26 AM
Old 03-24-2011
Change color or font when executing a script

I'm writing a simple menu script and I would like to output the whole script using background color: black AND foreground color:white. Meaning if the ssh terminal of a user is set to green for example, it will change to my desired color when menu script is executed. Once the script is exited, it will use his default color attributes. thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing font and color in log file of Script

Hi, We have process log with user defined error messages and information echos. I wanted to highlight error messgaes in that log file while writing in it. Is there any option with either echo or any other command which enables making text bold or we can change the font of body text of echo. ... (4 Replies)
Discussion started by: satgo
4 Replies

2. Shell Programming and Scripting

Font Color Change Using .profile

Does anyone know how can I change font color, background color etc for a particular user using .profile? Any help is appreciated. (0 Replies)
Discussion started by: fifo_vs_lifo23
0 Replies

3. UNIX for Dummies Questions & Answers

How to change the font or color of text

Hi Gurus, I have a small requirement where i want to change the color & font of some text in a file. i have a file error.txt which will be created in the script using egrep. After that iam adding these lines at head & tail to that file using the following code awk 'BEGIN{print"Please... (4 Replies)
Discussion started by: pssandeep
4 Replies

4. Shell Programming and Scripting

Specifying font type and color in a shell script

Hi, I am new to shell script. Can you please tell me, whether can we specify font type and color in a shell script? If so, how to do this? Thanks in advance. (4 Replies)
Discussion started by: Vani_Govind
4 Replies

5. Shell Programming and Scripting

font color in script

i am using ubuntu 11.04 and i just finished writing a shell script but i was wanting to know if their is a way to change the font color of just one sentence? (2 Replies)
Discussion started by: hotshot247
2 Replies

6. UNIX for Advanced & Expert Users

How to set font color for STDIN,STDOUT and STDERR?

I want to differentiate the STDOUT and STDERR messages in my terminal . If a script or command is printing a message in terminal I want to differentiate by colors, Is it possible ? Example: $date Wed Jul 27 12:36:50 IST 2011 $datee bash: datee: command not found $alias ls alias... (2 Replies)
Discussion started by: ungalnanban
2 Replies

7. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

8. Shell Programming and Scripting

How to change the color inside email using shell script?

hi, i want to send an email from unix using mailx command. mailx -s "subject" "email@abc.com" < email.txt Email.txt contains some file names that are transferred successfully and some that failed. so the files that got failed to tranfer, should be displayed in red color in the mail. is it... (1 Reply)
Discussion started by: Little
1 Replies

9. UNIX for Dummies Questions & Answers

Change font

how do i change from employee= to employee= in ksh. in my shell script, i just want to employee= to BOLD. (3 Replies)
Discussion started by: lawsongeek
3 Replies

10. Shell Programming and Scripting

Send mail with font color change

Hi All, I have a file that contains following entries. I want to highlight the line that has word as "FAILURE" while sending the email. File ------------------------------------------------------------ Job Name: ABC Start Time: 07/20/2019 07:32:39 End Time: 07/20/2019... (4 Replies)
Discussion started by: sdosanjh
4 Replies
NCURSES_INIT_PAIR(3)							 1						      NCURSES_INIT_PAIR(3)

ncurses_init_pair - Define a color pair

SYNOPSIS
int ncurses_init_pair (int $pair, int $fg, int $bg) DESCRIPTION
Defines or redefines the given color pair to have the given foreground and background colors. If the color pair was previously initial- ized, the screen is refreshed and all occurrences of it are changed to reflect the new definition. Color capabilities must be initialized using ncurses_start_color(3) before calling this function. The first color pair (color pair 0) is assumed to be white on black by default, but can be changed using ncurses_assume_default_colors(3). PARAMETERS
o $pair - The number of the color pair to define. o $fg - The foreground color for the color pair. May be one of the pre-defined colors or one defined by ncurses_init_color(3) if the terminal has color changing capabilities. o $bg - The background color for the color pair. May be one of the pre-defined colors or one defined by ncurses_init_color(3) if the terminal has color changing capabilities. RETURN VALUES
Returns -1 if the function was successful, and 0 if ncurses or color support were not initialized. NOTES
Note that color changing capabilities are not required for defining color pairs of pre-existing colors, but only for changing definitions (red, green, and blue components) of colors themselves per ncurses_init_color(3). EXAMPLES
Example #1 Writing a string with a specified color to the screen <?php ncurses_init(); // If the terminal supports colors, initialize and set active color if (ncurses_has_colors()) { ncurses_start_color(); ncurses_init_pair(1, NCURSES_COLOR_YELLOW, NCURSES_COLOR_BLUE); ncurses_color_set(1); } // Write a string at specified location ncurses_mvaddstr(10, 10, "Hello world! Yellow on blue text!"); // Flush output to screen ncurses_refresh(); ncurses_end(); ?> SEE ALSO
ncurses_pair_content(3), ncurses_start_color(3). PHP Documentation Group NCURSES_INIT_PAIR(3)
All times are GMT -4. The time now is 09:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy