Sponsored Content
Top Forums Shell Programming and Scripting Colloring Status of process or package Post 302245610 by cfajohnson on Friday 10th of October 2008 01:15:24 PM
Old 10-10-2008

Code:
case ${STATE_XCFA[1]} in
     UP) clr=32 ;;
     DOWN) clr=31 ;;
     *) clr=0;
esac
printf "STATUS: \e[${clr}m%s\e[0m | STATE: \e[${clr}m%s\e[0m | NODE: \e[${clr}m%s\e[0m|\n" \
       "${STATE_XCFA[1]}" "${STATE_XCFA[2]}" "${STATE_XCFA[4]}"

 

10 More Discussions You Might Find Interesting

1. AIX

Process status display

On AIX 5.2, I use "ps -ef " command to display the process status, the field of command looks like: , the detailed contents are: # ps -ef |grep rtesfmrt Display: osa 32455 1 0 18:20 - 1:57 The origianl format shoud be: osa 32455 1 0 18:20 - 1:57 ... (2 Replies)
Discussion started by: Frank2004
2 Replies

2. UNIX for Advanced & Expert Users

Getting status of a signal in process?

Hi all, How can a process be aware of the signals it handles. I looked at available signal API, but couldn't find any help. If a process defines it own handler for a signal, the default handler for that signal becomes overridden. I am interested in getting to know the... (2 Replies)
Discussion started by: bluehive
2 Replies

3. UNIX for Advanced & Expert Users

List Process with their Status.

Hi all, How can I get the list of all the processes that are either Orphan or Zombie or Running or Ended or Stopped ? Please suggest !! Thanks. Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies

4. Programming

process status

hello everybody!! i want to post a question! is there any way to get process status using C commands? To be more specific, i want to know whether a process is running or is stop or killed. thanks in advance! (3 Replies)
Discussion started by: nicos
3 Replies

5. UNIX for Advanced & Expert Users

Status of a Linux process

All, I have fair amount of knowledge about shell scripting, but only liitle on system administration. I would like to know how to analyze whether the particular linux process is alive or not ? If it is alive, will it affect the performace of other process ?. Also is it still consuming... (1 Reply)
Discussion started by: apsprabhu
1 Replies

6. Shell Programming and Scripting

How to Check the process Status and do something

Hi we have weblogic deployed under Linux Enterprise 5 . Now i want to write a script that checks if weblogic is running or not I have found that weblogic uses Java as process . Can i do this way : my Script File : Echo Checking Status if then echo Server Running else echo... (2 Replies)
Discussion started by: Ravi Pavanv
2 Replies

7. Shell Programming and Scripting

How to check the process status

Hi, I have a cron job which runs every ten minutes, now i hav to check the process whether it is running or not only once and then this should be sent to a log file.. crontab : 00,10,20,30,40,50 * * * * a process check ps = 'ps -ef |grep a ' if then echo " Success" >... (3 Replies)
Discussion started by: NehaKrish
3 Replies

8. AIX

List running services, Package name and status on AIX.

Hi, How can I list running services, corresponding package name and status on the AIX host? On Linux (Centos), I use the below code snippet:- for i in `chkconfig --list | awk '{ print $1}'`; do status=`/sbin/service $i status` packagename=`rpm -qf /etc/init.d/$i` done Is there... (2 Replies)
Discussion started by: Vipin Batra
2 Replies

9. HP-UX

List running services, corresponding package name and status.

Hi, I am trying to list down list of running services, corresponding package name and status on HP-UX box. The output will be a CSV in a fashion:- Service Name, Package Name, Status. While working on Linux centos, I used chkconfig to do the same. Below was the snippet:- for i in `chkconfig... (3 Replies)
Discussion started by: Happy83
3 Replies

10. UNIX for Beginners Questions & Answers

Check status of process

Hi All, Have a query How to check for a process and if down start it , try if for 2 times and its not starting don't do it My code is working to some extent but while starting try starting both times. Please advise , whats wrong here ? if you have any other approach please do share. My... (1 Reply)
Discussion started by: abhaydas
1 Replies
bkgrnd(3XCURSES)					  X/Open Curses Library Functions					  bkgrnd(3XCURSES)

NAME
bkgrnd, bkgrndset, getbkgrnd, wbkgrnd, wbkgrndset, wgetbkgrnd - set or get the background character (and rendition) of window using a com- plex character SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int bkgrnd(const cchar_t *wch); void bkgrndset(const cchar_t *wch); int getbkgrnd(cchar_t *wch); int wbkgrnd(WINDOW *win, const cchar_t *wch); void wbkgrndset(WINDOW *win, const cchar_t *wch); int wgetbkgrnd(WINDOW *win, cchar_t *wch); DESCRIPTION
The bkgrndset() and wbkgrndset() functions turn off the previous background attributes, logical OR the requested attributes into the window rendition, and set the background property of the current or specified window based on the information in wch. The bkgrnd() and wbkgrnd() functions turn off the previous background attributes, logical OR the requested attributes into the window ren- dition, and set the background property of the current or specified window and then apply this setting to every character position in that window: o The rendition of every character on the screen is changed to the new window rendition. o Wherever the former background character appears, it is changed to the new background character. If wch refers to a non-spacing complex character for bkgrnd(), bkgrndset(), wbkgrnd(), and wbkgrndset(), then wch is added to the existing spacing complex character that is the background character. If wch refers to a multi-column character, the results are unspecified. The getbkgrnd() and wgetbkgrnd() functions store, into the area pointed to buy wch, the window's background character and rendition. PARAMETERS
wch Is a pointer to the complex background character to be set. win Is a pointer to the window in which the complex background character is to be set. RETURN VALUES
The bkgrndset() and wbkgrndset() functions do not return a value. Upon successful completion, the other functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
add_wch(3XCURSES), add_wchnstr(3XCURSES), addch(3XCURSES), addchstr(3XCURSES), attroff(3XCURSES), bkgd(3XCURSES), clear(3XCURSES), clr- toeol(3XCURSES), clrtobot(3XCURSES), erase(3XCURSES), inch(3XCURSES), libcurses(3XCURSES), mvprintw(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 bkgrnd(3XCURSES)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy